TI-89 HomeGames ArchiveTitanium GamesGames How ToProgramsFAQForumTI-89 WikiLinks

Indirection Problems

 
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> BASIC Programming
Author Message
ghost ROM



Joined: 01 Dec 2010
Posts: 2

PostPosted: December 1, 2010 8:03 PM    Post subject: Indirection Problems Reply with quote

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
View user's profile Send private message
ghost ROM



Joined: 01 Dec 2010
Posts: 2

PostPosted: December 8, 2010 4:16 PM    Post subject: Reply with quote

Nevermind, I have created a new code segment that will serve as an alternative for this one.
Back to top
View user's profile Send private message
Jinx



Joined: 08 Jan 2011
Posts: 2

PostPosted: January 8, 2011 8:48 PM    Post subject: Reply with quote

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
View user's profile Send private message
mellamokb



Joined: 10 May 2007
Posts: 124

PostPosted: February 10, 2011 3:33 PM    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:    View previous topic : View next topic  
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> BASIC Programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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

Contact Us | Privacy Policy | Disclaimer | Trademarks

Copyright ©2006 All rights reserved.


Free Greeting Cards | Girly Myspace Layouts | Myspace Unblocker |