Jump to content
Developer Wiki and Function Reference Links ×

bail out


michaelk

Recommended Posts

What's the best way to handle a "Cancel" in a dialog box? I'd like the script stop running if cancel is chosen.

My current dialog handler looks something like this:

PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT);

BEGIN

CASE item OF

SetupDialogC:

BEGIN

Set Stuff....

END;

1:

BEGIN

Get Stuff.....

END;

END;

END;

Is it as simple as

0: ______________(Some command that means stop);

Thanks!

mk

Link to comment
  • Vectorworks, Inc Employee

2: would be the event of the "Cancel" Button but you really want to check the return value from RunLayoutDialog call outside of the dialog handler.

If it's not 1 then the user canceled or closed the dialog without hitting the OK button.

There are typically 3 default IDs used by the dialog.

1: OK Button

2: Cancel Button

3: Help Box

so your first control should be 4.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...