Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[原创]导入导出全局变量

1楼
z7c9 发表于:2013/10/22 21:46:36

dim appname
dim filename

 

appname="weistock"
filename="c:\weistock.csv"

 

 

sub exportgbdata() 
 set fso=createobject("scripting.filesystemobject")
 set file=fso.opentextfile(filename,2,true)
 
 for i=0 to document.ExtDataNum-1
  value=document.GetExtDataByIndex(i,key)
  file.writeline(key&","&value&","&"数字")
 next
 
 for i=0 to document.ExtDataStringNum-1
  value=document.GetExtStringByIndex(i,key)
  file.writeline(key&","&value&","&"字符串")
 next
 
 file.close
 

end sub

 

 

 

sub importgbdata() 
 set fso=createobject("scripting.filesystemobject")
 set file=fso.opentextfile(filename,1,true)
 
 while file.atendofline<>true
  line=file.readline
  
  dim array
  array=split(line,",")
  
  if array(2)="数字" then
   document.SetExtData array(0),array(1)
  elseif array(2)="字符串" then
   document.SetExtString array(0),array(1)
  end if
 wend
 
 file.close
 

end sub

[此贴子已经被作者于2013/10/22 21:47:49编辑过]
2楼
王锋 发表于:2013/10/22 22:23:21
不错支持一下
共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03906 s, 2 queries.