User Manual - Page 129

For N3/TBL/1L1/J.

Loading ...
Loading ...
Loading ...
remain()
Catalog >
As a consequence, note that remain(x,y)
remain(x,y). The result is either zero or it
has the same sign as the first argument.
Note: See also mod(), page 94.
Request
Catalog >
Request promptString, var[,DispFlag
[,statusVar]]
Request promptString, func(arg1, ...argn)
[,DispFlag [,statusVar]]
Programming command: Pauses the
program and displays a dialog box
containing the message promptString and
an input box for the user’s response.
When the user types a response and clicks
OK, the contents of the input box are
assigned to variable var.
If the user clicks Cancel, the program
proceeds without accepting any input. The
program uses the previous value of var if
var was already defined.
The optional DispFlag argument can be
any expression.
If DispFlag is omitted or evaluates to 1,
the prompt message and user’s response
are displayed in the Calculator history.
If DispFlag evaluates to 0, the prompt
and response are not displayed in the
history.
Define a program:
Define request_demo()=Prgm
Request “Radius: ”,r
Disp “Area = “,pi*r
2
EndPrgm
Run the program andtype a response:
request_demo()
Resultafter selecting OK:
Radius: 6/2
Area= 28.2743
The optional statusVar argument gives the
program a way to determine how the user
dismissed the dialog box. Note that
statusVar requires the DispFlag argument.
If the user clicked OK or pressed Enter or
Ctrl+Enter, variable statusVar is set to a
value of 1.
Otherwise, variable statusVar is set to a
value of 0.
Define a program:
Define polynomial()=Prgm
Request "Enter a polynomial in
x:",p(x)
Disp "Real roots are:",polyRoots
(p(x),x)
EndPrgm
Run the program andtype a response:
polynomial()
Alphabetical Listing 125
Loading ...
Loading ...
Loading ...