I'm trying to write a program that asks the user for a number of inputs, then asks for each input and loops until the index reaches the number. The problem is, I want to store each input as an individual variable. As well, the number of inputs is variable. I tried getting around this by using the subscript function and storing each input as Xi where i is the variable I use as my loop index. The loop goes something as follows:
program(n)
0->i
while i<n
i+1->i
request "Enter input.",Xi,0
endwhile
That's the snippet I'm working with anyway. The end goal of this is to be able to display every number inputted in a set (this is an offshoot of an independent statistics project, and it's much easier to do stat calculations with sets). The result I was hoping for was for there to be X1, X2, X3… Xn as all separate variables, automatically generated. The problem is that the subscript function on the Ti-Nspire automatically stores whatever's in the subscript as a string, and not an expression. My friend (experienced only on the Ti-83) suggested string concatenation. He had a good idea, so I changed it to
request "Enter input.",expr("x"&string(i)),0
which should theoretically force i to become its assigned numeric value and glue itself to X. Theoretically, there's no reason it wouldn't work, but it threw an "Invalid variable or function name" at me. I isolated that chunk of the program into another program to make sure it wasn't any lingering errors, and it still gave me the error.
My question is: Is there any way to procedurally generate variable names, given that you have a variable number of, well, variables?