
maybe, to early in the morning for an unemployed to discuss technical stuff in another language.
Code: Select all
if (file = fopen("test.txt","rb")) {
// etc
}
Why can't the OpenFile function just raise error number 53 for us, so that we can catch it that way?You can forcibly fire an error. For example if you did not find a file, fire an error number 53 and let the error handler show the error for you.
What you want is impossible, because in PB (and all Basics) compare (is eqal) and "set" is the same char (=).MLK wrote:just want to say...
i like this more:then:Code: Select all
If CreateFile(#file=#PB_Any,file$) DeleteFile(file$) EndIf
Code: Select all
If #file=CreateFile(#PB_Any,file$) DeleteFile(file$) EndIf
Code: Select all
Procedure CreateFileX(*Handle.LONG,File$)
*Handle\l=CreateFile(#PB_Any,File$)
ProcedureReturn *Handle\l
EndProcedure
If CreateFileX(@GetNb,"C:\Test.txt")
CloseFile(GetNb)
EndIf