| Author |
Message |
ghost ROM
Joined: 01 Dec 2010 Posts: 2
|
Posted: December 1, 2010 8:03 PM Post subject: Indirection Problems |
|
|
| Code: |
:For i,1,n,1
:Local #("cx"&string(i)),#("ca"&string(i))<--"Error: Invalid variable name in a Local statement"
:Input "blahblahblah",#("cx"&string(i))<--"Error: Indirection string is not a valid variable name"
:Input "blahblahblah",#("ca"&string(i))<--"Error: Indirection string is not a valid variable name"
:EndFor
|
I can't figure out what is wrong with the indirection statements. I have all variables involved assigned as local variables (i,n). Any clarification on what is wrong with the given strings would be greatly appreciated. I really want this vector program to be done and working; everything else on the program works except this lone For...EndFor block. If you need to see the rest of the program, just let me know. |
|
| Back to top |
|
 |
ghost ROM
Joined: 01 Dec 2010 Posts: 2
|
Posted: December 8, 2010 4:16 PM Post subject: |
|
|
| Nevermind, I have created a new code segment that will serve as an alternative for this one. |
|
| Back to top |
|
 |
Jinx
Joined: 08 Jan 2011 Posts: 2
|
Posted: January 8, 2011 8:48 PM Post subject: |
|
|
I know you found another solution, but just for reference: I wonder if perhaps the parenthesis you used were unnecessary? I haven't tried it on my TI-89, but maybe you could try simply:
| Code: | For i,1,n,1
Local #"cx"&string(i)
EndFor |
or, failing that, perhaps
| Code: | Local stringi
For i,1,n,1
"cx"&string(i)->stringi
Local #stringi
EndFor |
Not sure if the first method would allow declaring multiple local variables using a comma, but I suspect it would.
There is some more information on http://tibasicdev.wikidot.com :
Local
Indirection
Hopefully this helps. |
|
| Back to top |
|
 |
mellamokb
Joined: 10 May 2007 Posts: 124
|
Posted: February 10, 2011 3:33 PM Post subject: |
|
|
Hi ghost ROM,
I just might add, that it might be easier to run your program in a separate folder, and forget about trying to define local variables. Allow the variables to be global, and if they are in a separate folder that you don't use regularly, then it should be ok if they get overwritten.
I was able to get this code to run fine:
Input "blahblahblah",#("cx"&string(i))
Verify that the value of i is what you expected it to be.
Hope this helps!
Regards,
~ mellamokb |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
Saphic 1.5 // Theme created by Sopel
|
|