3 getting user input to a script – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual
Page 108
N
AURTECH
W
EB
B
ROWSER AND
T
ERMINAL
E
MULATION FOR
W
INDOWS
CE
AND
W
INDOWS
M
OBILE
CETerm Scripting Guide
Page 108
m.Progress = 0;
m.IsVisible = true;
OS.Sleep( 2000 ); // Simulate work delay
// Update
m.Progress = 20;
m.Text = "Finding addresses, please wait.";
OS.Sleep( 2000 ); // Simulate work delay
// Update
m.Progress = 50;
m.Text = "Sorting addresses, please wait.";
OS.Sleep( 2000 ); // Simulate work delay
// Update
m.Progress = 90;
m.Text = "Almost done, please wait.";
OS.Sleep( 2000 ); // Simulate work delay
// Done
m.IsVisible = false;
5.3
G
ETTING
U
SER
I
NPUT TO A
S
CRIPT
The TextInput object can get user input for a script. Here is an example for
getting a password.
/* Get password from user */
var t = CETerm.TextInput;
t.Title = "Warehouse Management";
t.Prompt = "Please enter your password:";
t.PasswordMode = true;
t.Input = ""; // Clear current password
var s = t.GetInput();
if (s == 1)
{
OS.Alert( "Password is " + t.Input );
t.Input = ""; // Clear password
}
else
{
OS.Alert( "Failed to get password." );
}