Hiya everybody! I am a month-old newbie programmer who only knows a little TI-BASIC and that is all.I am having trouble with the following bit of code. Any solution/help would be greatly appreciated. Here it is!
Condensed explanation: I want this:
I thought this would let me input A but it gives me a syntax error. I figured out this is because expr("A" is changing to whatever value was stored to variable A. Instead, I want to be able to take the letter A out of the string as the letter A with no quotes, so that I can input A. Is there a way I can do this?
Long-story explanation: I am making a linear system of equations solver (using Cramer's rule) to solve systems of 2, 3 or 4 linear equations. First I have the user input the number of equations/variables to variable Y, then I say
(If Y=2) enter the values A thru F for the equations ax + by = c, dx + ey = f
(If Y=3) enter the values A thru K for the equations ax + by + cz = d, ex + fy… and so on for the three equations
(If Y=4) enter the values A thru T for the equations ax + by +cz +dw = f, gx + … and so on for the four equations
—then I have the following code to get the variables
:"ABCDEFGHIJKLMNOPQRST->Str1 :1->Z :Repeat Z=(Y^2)+Y+1 :Input sub(Str1,Z,1),expr(sub(Str1,Z,1 :Z+1->Z :End
*Note: (Y^2)+Y+1 is the number of coefficients needed to be entered for the system of Y equations
I intended this code to ask for the variables A thru (F or K or T, depending on the number of equations)
The part that is not working is the expr(sub(Str1,Z,1)). I want it to give the variable to be inputted in as, but instead it is giving it as the number stored to that variable.
Is there a piece of code I can use that will give then variable instead of the value of the variable in the string? Some Xfunctioncommandthingie that would do:
gives out A with no quotes around it yet not giving the value of A.
Thank you thank you thank you times a million is the reward for anybody who helps me!
ALSO! If you don't know exactly how to solve this problem but know any good way of getting around it, I'm open to that as well!