ich lese von einer Exceldatei Werte aus und schreibe sie in eine Textdatei. Das klappt mit dieser Version auch gut.
Hier der gekürtzte Teil vom Programm:
Code: Alles auswählen
For i=2 To 1500 ; in Excelseite mit 2. Zeile beginnen mit auslesen
bla
bla
bla
If OpenFile(1,"C:\GAS.TAB")
While Eof(1) = 0
If gastabs.s=gastabelles.s
FileSeek(1,(zeilel.l-1)*247+20)
WriteString(1, gasflowmaxs.s)
jahrs.s=FormatDate("%yyyy",Date())
monats.s=FormatDate("%mm",Date())
tags.s=FormatDate("%dd",Date())
stundens.s=FormatDate("%hh",Date())
minutens.s=FormatDate("%ii",Date())
sekundens.s=FormatDate("%ss",Date())
textgesamtgastabs.s = gastabelles.s+" "+tags.s+"."+monats.s+"."+jahrs.s+" "+stundens.s+":"+minutens.s+":"+sekundens.s+" "+gasflowmaxs.s+" "+gasflowmins.s+" "+testgasviscositys.s+" "+testgasdensitys.s
If OpenFile(2,"C:\Gas.log")
laengel.l= Lof(2)
FileSeek(2,laengel.l)
WriteStringN(2,textgesamtgastabs.s)
CloseFile(2)
EndIf
EndIf
Wend
Else
MessageRequester("Uyarı","Gas tablosu acamadı!")
EndIf
CloseFile(1)
Next i
Das Ergebnis war folgendes. Ich habe die OPENFILE und CLOSEFILE ausserhalb von der FOR NEXT Schleife gelegt.
Code: Alles auswählen
If OpenFile(1,"C:\GAS.TAB")
If OpenFile(2,"C:\Gas.log")
For i=2 To 1500 ; in Excelseite mit 2. Zeile beginnen mit auslesen
bla
bla
While Eof(1) = 0
If gastabs.s=gastabelles.s
FileSeek(1,(zeilel.l-1)*247+20)
WriteString(1, gasflowmins.s)
jahrs.s=FormatDate("%yyyy",Date())
monats.s=FormatDate("%mm",Date())
tags.s=FormatDate("%dd",Date())
stundens.s=FormatDate("%hh",Date())
minutens.s=FormatDate("%ii",Date())
sekundens.s=FormatDate("%ss",Date())
textgesamtgastabs.s = gastabelles.s+" "+tags.s+"."+monats.s+"."+jahrs.s+" "+stundens.s+":"+minutens.s+":"+sekundens.s+" "+gasflowmaxs.s+" "+gasflowmins.s+" "+testgasviscositys.s+" "+testgasdensitys.s
laengel.l= Lof(2)
FileSeek(2,laengel.l)
WriteStringN(2,textgesamtgastabs.s)
EndIf
Wend
Next i
Else
MessageRequester("Uyarı","Exel-WINTED-Gas.log dosyası acamadı!")
EndIf
Else
MessageRequester("Uyarı","Gas tablosu acamadı!")
EndIf
CloseFile(2)
CloseFile(1)
Hat da einer eine Idee woran das Liegt ( EOF kommt ja normalerweise direkt nach dem OPENFILE - ist es das? )