🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Closing a program

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Hey guys,

 

I'm looking for a .tcl-command to completely close a program. The program starts with a messagebox where you can choose yes or no. If you select yes, the program runs as it is planned.

If you choose no, the whole program should stop. There for I used the exit 2 command.

But instead of closing the whole program it only closes the message box and tries to run the code afterwards.

Do you have an idea how to fix that problem?

 

This is the relevant part of the code:

set starting [tk_messageBox -message 'Möchten Sie eine vorhandenes Modell verwenden?' -type yesno -icon question -title 'Einladen des Modells']
switch -- $starting {
yes {
set basedir {C:/}
set filetypes {{{Text} {*.fem}} {{Alle} {*}}}

set par [tk_getOpenFile \
        -initialdir [pwd]\
        -title 'Startdatei wählen...'\
        -filetypes $filetypes
        ]
    *feinputwithdata2 '\#optistruct\\optistruct' '$par' 0 0 0 0 0 1 9 1 0
    }
    no {
        exit 2
        }
    }

*createentity mats cardimage=MAT1 name=material1

...

 

Kind regards,

Simon

Find more posts tagged with

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

    Hi

    'exit' is to close hypermesh.

    Use 'return' instead, to cancel a script