Catch Method similar to VBA

User: "Jouher_20929"
Altair Community Member
Updated by Jouher_20929

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??

 

 

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Mario_21478"
    Altair Community Member
    Updated by Mario_21478

    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