Dear CalcLoverHK
Maybe following helps you;
This is rather new command (from Manual_EN.txt) ;
-------------------------------------------------------------------------------
Try~Except~TryEnd + (PRGM)- (CONTROL)- - (Try)
(lator Ver.2.00)
-------------------------------------------------------------------------------
Exception handling can be performed according to the error.
(Format) Try <program>
Except error code 1
<Processing for error1>
Except error code 2
<Processing for error2>
TryEnd
If there is no error in <program>, processing moves after TryEnd.
If error1 occurs, processing will move after TryEnd after executing <Process for error1>.
If error2 occurs, processing will move after TryEnd after executing <Process for error2>.
When Error3 occurs, an error pop-up appears because there is no corresponding Except.
(Format) Except
If there is no Except corresponding to an error, "Error" is executed because Except with no argument corresponds to all errors.
(Example) Try 3*4+
Except 1
"Syntax Error"
TryEnd
"Syntax Error" is executed, since SyntaxError error code is 1.
(Example) Try 3*4/0
Except 1
"Syntax Error"
Except 40
"Divide by Zero"
TryEnd
“Divide by Zero”is executed, since division by zero error code is 40.
(Example) Try 3*4/0
Except 1
"Syntax Error"
Except
"Error"
TryEnd
If there is no Except corresponding to an error, "Error" is executed because Except with no argument corresponds to all errors.
The sample program is in CBasic_sample/Try_Except.
Refer to ErrorCode_List.txt for the error code.
Hi sentaro21,
Is there a way to treat the undefined value?
Example:
Undefined(1÷0)=>"Undefined ERROR"It will show "Undefined ERROR" instead of showing the error message.
The "Undefined(" command is for not showing the error message. It will return 1 or 0 depend on the expression.
Cheers,
CalcLoverHK
Edited by Krtyski, 03 September 2019 - 07:55 AM.