User Manual - Page 130

For N3/TBL/1L1/J.

Loading ...
Loading ...
Loading ...
126 Alphabetical Listing
Request
Catalog >
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 126.
Resultafter entering x^3+3x+1 and selecting
OK:
Real roots are: {-0.322185}
RequestStr
Catalog >
RequestStr promptString, var[, DispFlag]
Programming command: Operates
identically to the first syntax of the Request
command, except that the user’s response
is always interpreted as a string. By
contrast, the Request command interprets
the response as an expression unless the
user encloses it in quotation marks (““).
Note: You can use the RequestStr command
within a user-defined program but not
within a function.
Define a program:
Define requestStr_demo()=Prgm
RequestStr “Your name:”,name,0
Disp “Response has “,dim(name),”
characters.”
EndPrgm
Run the program andtype a response:
requestStr_demo()
Loading ...
Loading ...
Loading ...