Try Catch Endcatch

Feature requests for future versions of Hollywood can be voiced here
Post Reply
P_B
Posts: 28
Joined: Sat Sep 15, 2018 4:28 pm

Try Catch Endcatch

Post by P_B »

Hello,

To prevent a running program from stopping, it would be good if the developer could manage his own error messages, but also if the program did not stop.

Code: Select all

Try

  lines that can cause errors

Catch

  lines to execute on error

EndCatch
Thank you in advance
Flinx
Posts: 342
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: Try Catch Endcatch

Post by Flinx »

You have already such a mechanism. Look at 7.7 Error handling.
Example:

Code: Select all

Local err, id = ?OpenFile(Nil, "nonexistent")
If err<>#ERR_NONE
	DebugPrint("error")
Else
	DebugPrint("no error, id is", id)
EndIf
P_B
Posts: 28
Joined: Sat Sep 15, 2018 4:28 pm

Re: Try Catch Endcatch

Post by P_B »

Thank you Flinx for your help.
Post Reply