Boyi master data is transmitted to Feihu dealer VBS.
Sub Main ()' script main program, please write the main program code here.
DateNum= 10 '0 means all imports. When initializing, all the data will be imported. It is recommended to update only the data of the last few days in the future. 10 means that only the latest 10 days are exported.
Strfile = "e: \ securitydata \ pobo \ data \ nyefut \ day \ conc.day"' Boyi master's daily archives (continuous crude oil in the United States)
File name = "c: \ txtday \ ididconc.txt"' Export file (dealer standards text file of Flying Fox).
PoboToFoxtraderTXT file, file name, date
End Sub' script main program ends.
Sub PoboToFoxtraderTXT(strFile,fileName,dateNum)
Const ForReading = 1,ForWriting = 2,ForAppending = 8
const tristeusedefault =-2,TristateTrue = - 1,TristateFalse = 0
Dim object stream, fso, Gage (10)
set objStream = CreateObject(" ADODB。 Stream ")
objStream。 Type = 1
objStream。 open
objStream。 LoadFromFile strFile
If dateNum=0, then
dateNum = objStream.Size/32
ElseIf dateNum & lt and then objStream.Size/32.
dateNum=dateNum
other
dateNum=objStream。 Size /32
If ... it will be over.
objStream.position = objStream。 Size-dateNum*32
For i = 1 to dateNum
readFile = AscB(objStream。 Pronounced as (1))+AscB(objStream. Pronounced as (1))*256+AscB(objStream. Pronounced as (1)) * 256 * 256+ascb (objstream). Pronounced as (1))*256*256*256
nian = readFile\ 1048576
Yue = readfile 65536-nian *16+100
ri =(readFile Mod 65536)\ 256 \ 8+ 100
riQi = CStr(nian)+"/"+Right(CStr(yue),2)+"/"+Right(CStr(ri),2)
For j = 1 to 4
readFile = AscB(objStream。 Pronounced as (1))+AscB(objStream. Pronounced as (1))*256+AscB(objStream. Pronounced as (1)) * 256 * 256+ascb (objstream). Pronounced as (1))*256*256*256
Jiage (j) =CStr(readFile/ 1000)+ ""
then
Objstream。 position = objstream。 The data structure of position+ 12' volume and position is unknown, so it will not be exported for the time being!
Shu Chu = Shu Chu+Riqi+""+Jia Ge (2)+ Jia Ge (3)+ Jia Ge (4)+ Jia Ge (1)+vbCrLf
Riqi = ""
then
objStream。 close
Set objStream = Nothing
Set fso=CreateObject("Scripting。 File system object ")
If fso. FolderExists("C:\TXTDAY ") and then
i=0
other
fso。 CreateFolder ("C:\TXTDAY ")
If ... it will be over.
Set MyFile=fso. OpenTextFile (file name, ForWriting, True, TristateFalse)
My papers. WriteLine bookcase
MyFile.close
Set MyFile = Nothing.
Set fso = none.
End joint