EasyManua.ls Logo

Texas Instruments TI-92+

Texas Instruments TI-92+
507 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
This idea can be extended to more than two variables. The program req3var() shows how to get three
variables from one Request command.
req3var()
Prgm
©Demo, get three variables in one Request
©14oct00 dburkett@infinet.com
local s1,s2,x,y,z,xyz
©Set default values for x, y and z
1x
2y
3z
©Combine x, y and z for default prompt
string(x)&","&string(y)&","&string(z)xyz
©End up here if user omits commas between x, y and z
lbl tryagain
©Prompt for x,y and z
dialog
title "GET X, Y AND Z"
request "x,y,z",xyz ©x, y and z will be in string xyz
enddlog
if ok=0:return ©Let user quit by pressing [ESC]
©Find the comma positions in xyz
instring(xyz,",")s1 ©s1 is the position of the first comma
instring(xyz,",",s1+1)s2 ©s2 is the position of the second comma
©Test for commas
if s1=0 or s2=0 then
dialog ©Display error message if both commas
title "ERROR" ©not found
text "You must put commas"
text "between x, y and z"
enddlog
if ok=0:return ©Let user quit by pressing [ESC],
goto tryagain ©or try again by pressing [ENTER]
endif
©Convert x,y and z strings to expressions
expr(left(xyz,s1-1))x
expr(mid(xyz,s1+1,s2-s1-1))y
expr(right(xyz,dim(xyz)-s2))z
©Just for a demo, display x, y and z. Your application probably won't do this
dialog
title "SHOW X, Y AND Z"
text "x is "&string(x)
text "y is "&string(y)
text "z is "&string(z)
enddlog
EndPrgm
9 - 15

Table of Contents

Related product manuals