[ ??? ] FileOpen() Exception
Posted: 14 Feb 2020, 10:44
It is madness:When serial (com1) is taken by another program FileOpen() void exception Access Denied and comm variable keep its value.
It is in times easier FileOpen() to return 0 or ""
I understand exceptions when Read/Write to file but this is true madness like in Java.
Code: Select all
#SingleInstance Force
comm:= FileOpen('\\.\COM1', "w")
It is in times easier FileOpen() to return 0 or ""
Code: Select all
#SingleInstance Force
if comm:= FileOpen('\\.\COM1', "w") {
;file actions
}
Code: Select all
#SingleInstance Force
comm:= 'madness'
try if comm:= FileOpen('\\.\COM1', "w") {
;file actions
}
catch
MsgBox('access denied')
MsgBox(type(comm) ' -> ' comm)