Application Guide

Request
Catalog >
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.
The func() argument allows a program to
store the user’s response as a function
definition. This syntax operates as if the
user executed the command:
Define func(arg1, ...argn) = user’s
response
The program can then use the defined
function func(). The promptString should
guide the user to enter an appropriate
user’sresponse that completes the
function definition.
Note: You can use the Request command
within a user-defined program but not
within a function.
To stop a program that contains a Request
command inside an infinite loop:
Handheld: Hold down the c key and
press · repeatedly.
Windows®: Hold down the F12 key and
press Enter repeatedly.
Macintosh®: Hold down the F5 key and
press Enter repeatedly.
iPad®: The app displays a prompt. You
can continue waiting or cancel.
Note: See also RequestStr, page 151.
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 and type a response:
polynomial()
Result after entering x^3+3x+1 and selecting
OK:
Real roots are: {-0.322185}
RequestStr
Catalog >
RequestStr promptString, var[, DispFlag]
Define a program:
Alphabetical Listing 151