
80
Class Reference
Example:
alert(samplefunction, "Status Alert");
Displays the alert shown in Figure 717 and waits until the operator presses the enter key or
the left softkey (OK). Once the operator presses a key, it calls
samplefunction()
to
continue.
Figure 16 – Alert Example
4.6.1.2
confirm
The confirm function displays text in the display area of the standard GUI display and
returns a value based on the key pressed. Do not call this function within onDecode and
onCommand event handlers.
Format:
result = confirm(yesFunc, noFunc, text);
Where:
yesFunc
– function name; function to be called when the confirm receives left softkey.
This function does not take any arguments and returns void.
noFunc
– function name; function to be called when the confirm receives right softkey.
This function does not take any arguments and returns void.
text
– string; text to display for confirmation.
result
– Boolean;
true
if the confirm receives an enter key (either the enter key or the
left softkey defined as
OK)
;
false
if the confirm receives the right softkey defined as
Cancel
.
Processing suspends until the operator presses a suitable key.
Example:
result = confirm(onYesClick, onNoClick, "Exit?");
Displays the confirm dialog shown in Figure 818 and waits until the operator presses the
enter key or the left softkey. If operator presses Ok key, it calls onYesClick function. If
operator presses Cancel key, it calls onNoClick function to continue processing.