...
Scroll tablelayout | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Return value
integer
Examples
Code Block | ||
---|---|---|
| ||
// Prompt the user with a message and proceed according |
...
// to the button that was clicked. Make No the default button |
...
int $returnCode; |
...
boolean $shouldSave; |
...
$returnCode = `messagePrompt "Not all nodes are selected for export.\n\n Do you still want to save?" -yesNoCancel 0`; |
...
switch( $returnCode ) |
...
{ |
...
case -1: // User clicked Cancel. Exit the script |
...
return; |
...
case 0: // User clicked No. Don't save |
...
$shouldSave = false; |
...
break; |
...
case 1: // User clicked Yes. Can proceed with save |
...
$shouldSave = true; |
...
break; |
...
} |
...
// Save if it's safe to save, according to the user. |
...
$if( $shouldSave ) |
...
{ |
...
saveFile -s; |
}
Additional information
Related commands
...