Posted: Wed Apr 09, 2003 2:25 pm
Restored from previous forum. Originally posted by Ralf.
I wrote a programm which should the whether a file is there or not.
If C:\DB95-EIN\.....002 is not there is should go further to check
whether .001 is there but my programm stops after it checked and found
out that there is no .002. But i have .001 and it should tell me.
Whats wrong with it ?
b$="."
GetLocalTime_(time.SYSTEMTIME)
b$=b$+Str(time\wYear)
a$=Str(time\wMonth): If Len(a$)=1 : a$="0"+a$ : EndIf : b$=b$+a$
a$=Str(time\wDay-1) : If Len(a$)=1 : a$="0"+a$ : EndIf : b$=b$+a$
ReadFile$ = "C:\DB95-EIN\B100016" + b$ + ".001"
ReadFile2$ = "C:\DB95-EIN\B100016" + b$ + ".002"
If ReadFile(1, ReadFile2$)
MessageRequester("Dateieingang: ","DATEI: " + ReadFile2$ + " vorhanden ...", 0)
CloseFile(1)
Else
MessageRequester("Nachricht", "Fehler: Kann Datei" + ReadFile2$ + " nicht lesen !", 0)
ElseIf ReadFile(2, ReadFile$)
MessageRequester("Dateieingang: ","DATEI: " + ReadFile$ + " vorhanden ...", 0)
CloseFile(2)
Else
MessageRequester("Nachricht", "Fehler: Kann Datei nicht lesen !", 0)
EndIf
I wrote a programm which should the whether a file is there or not.
If C:\DB95-EIN\.....002 is not there is should go further to check
whether .001 is there but my programm stops after it checked and found
out that there is no .002. But i have .001 and it should tell me.
Whats wrong with it ?
b$="."
GetLocalTime_(time.SYSTEMTIME)
b$=b$+Str(time\wYear)
a$=Str(time\wMonth): If Len(a$)=1 : a$="0"+a$ : EndIf : b$=b$+a$
a$=Str(time\wDay-1) : If Len(a$)=1 : a$="0"+a$ : EndIf : b$=b$+a$
ReadFile$ = "C:\DB95-EIN\B100016" + b$ + ".001"
ReadFile2$ = "C:\DB95-EIN\B100016" + b$ + ".002"
If ReadFile(1, ReadFile2$)
MessageRequester("Dateieingang: ","DATEI: " + ReadFile2$ + " vorhanden ...", 0)
CloseFile(1)
Else
MessageRequester("Nachricht", "Fehler: Kann Datei" + ReadFile2$ + " nicht lesen !", 0)
ElseIf ReadFile(2, ReadFile$)
MessageRequester("Dateieingang: ","DATEI: " + ReadFile$ + " vorhanden ...", 0)
CloseFile(2)
Else
MessageRequester("Nachricht", "Fehler: Kann Datei nicht lesen !", 0)
EndIf