Catch Method similar to VBA
Jouher_20929
Altair Community Member
In VBA, we have lot of error handling say like:
On Error GoTo ErrorMsg
--> Code
Done:
Exit Function
Error Msg;
- do in error case
I sthere any similar way in TCL??
0
Answers
-
Hello,
Most commands supporting the catch error handling.
if { [ catch {command_name...} ] } {
# Handle error
}
e.g. error handling if already a panel is open, it is not allowed in HW to stack panels:
if { [catch {*createmarkpanel lines 1 'Select first line ...'}] } {
set Info01Label 'Warning: Can't Stack Panels'
update
return
}
Best Regards,
Mario
0