TIB: Re: Infinant requesting on ti-89 basic


[Prev][Next][Index][Thread]

TIB: Re: Infinant requesting on ti-89 basic




One way to do this is to use indirection on the 89.  You input the number of
variables to be stored from the user, then you make a loop which stores
other inputs to variables.

    Example code:
:Input "How many variables?",n
:For x,1,n
:    Input "Value?",#("a"&string(x))
:EndFor

And now you'd have n variables named a1,a2,a3... etc.

Another way to do it, which I do more often, is to input lists.  You have
the user input one variable, but in list form so there can be as many values
as needed.

    Example code:
:Disp "Values?"
:Disp "(separate with commas)"
:InputStr x
:expr("{"&x&"}") /->/ x

So you'd have a list named x containing all the values.

~Dave <the_regul8r@bigfoot.com>


-----Original Message-----
From: Mike <cassetti@yahoo.com>
To: ti-basic@lists.ticalc.org <ti-basic@lists.ticalc.org>
Date: Thursday, February 18, 1999 4:08 PM
Subject: TIB: Infinant requesting on ti-89 basic


>hi, i have allways wanted to know
>how to ask someone how many things they want to store, and it stores
>things to the specified # of times
>EX:
>i tell a program that i want to add 10 phone #'s, the program askes me
>to enter 10 phone #'s, and if i told it 50 phone numbers, it would
>prompt me for 50 phone #'s ( or some other thing! )
>
>What are the commands that i would use??
>I need to know for a program that will be a study guide. This program
>(for the 89) will ask for a question and the answer to the questions
>and then it will randomly ask you the questions you answered ( to help
>you study)