I try to create an file importer, called an test to figure out how i can create an file exception handler,
just if the file is not found, then give an error... but it don't works...
So this is my script, written in PB5.6.2, on windows XP:
Code: Select all
;Make File Error
Procedure GetFileError()
MessageRequester("Fatal Error!", "Cant find File", #PB_MessageRequester_Error)
EndProcedure
;Try to find File
File$ = OpenFileRequester("Import", "doc.txt", "Text (*.txt) | *.txt", 0)
If File$
MessageRequester("File Info", File$, #PB_MessageRequester_Info)
Else
OnErrorCall(@GetFileError())
EndIf
So the problem is at follow...
I try to program my file importer so, thad you can import an *.txt file as standart doc.txt (initialized),
but i want thad if the file is found, than show an message with the given file, but if not... than it must
be give an error, called "Fatal Error!", "Can't find the File"... as an MessageError.
But the problem is thad the error must be given if the file isn't found, but the exception error handling
does not works yet...
So can you try to find the problem and than correct my code, pleace?...
Thanks for code correction, Jamie.