Code : Tout sélectionner
Procedure.l ErrorBox(msg.s = #NULL$)
If msg = #NULL$
msg = Space(4096)
FormatMessage_(#FORMAT_MESSAGE_FROM_SYSTEM, 0, GetLastError_(), 0, msg, Len(msg), 0)
EndIf
MessageRequester(GetFilePart(#PB_Compiler_File), msg, #MB_ICONERROR)
EndProcedure
If ReadFile(0, "no-file.txt") Or ErrorBox()
Debug "ok"
CloseFile(0)
EndIf
If ExamineDirectory(0,"no-dir","") Or ErrorBox()
Debug "ok"
EndIf