Just a thought.
Sometimes it could be usefull to De-Init some stuff if quitting an application due to fatal errors in procedures. Then often I use the END command inside procedures to quit the app. But before I need to release and free some API Stuff using an own Procedure DeInitEND() and sometimes I forget this before the END command.
So, it would be nice to specifiy optionaly an Procedure to the END command which will be executed before the real END command is executed.
Not a big deal, maybe makes thinks a little big more easy.
Thanks for reading.
End [@Procedure(),Value.l,Timeout.l)
End [@Procedure(),Value.l,Timeout.l)
Tranquil
PB 4.0:
If you use End() or End(ExitCode) then the procedure CleanUpAndEnd() is called. If you only use End (without brackets) the program terminates immediately.
cu, helpy
Code: Select all
Macro End(ExitCode=0)
CleanUpAndEnd(ExitCode)
EndMacro
Procedure CleanUpAndEnd(ExitCode)
If ExitCode <> 0
MessageRequester("CleanUP","Programm will be terminated!" + #CRLF$ + #CRLF$ + "ExitCode: " + Str(ExitCode))
EndIf
End ExitCode
EndProcedure
Procedure test1(c)
If c=5
End(1)
EndIf
EndProcedure
;test1(1)
test1(5)
End()
cu, helpy