EAGLE Help

dlgAccept()


Function
Closes the dialog and accepts its contents.

Syntax
void dlgAccept([ int Result ]);

Description
The dlgAccept function causes the dlgDialog to be closed and return after the current statement sequence has been completed.

Any changes the user has made to the dialog values will be accepted and are copied into the variables that have been given when the dialog objects were defined.

The optional Result is the value that will be returned by the dialog. Typically this should be a positive integer value. If no value is given, it defaults to 1.

Note that dlgAccept() does return to the normal program execution, so in a sequence like

dlgPushButton("OK") {
  dlgAccept();
  dlgMessageBox("Accepting!");
  }
the statement after dlgAccept() will still be executed!
See also dlgReject, dlgDialog, A Complete Example

Example

int Result = dlgDialog("Test") {
               dlgPushButton("+OK")    dlgAccept(42);
               dlgPushButton("Cancel") dlgReject();
               };

Index Copyright © 2005 CadSoft Computer GmbH