Code:
Fill(1,listname
ok, it is all real variables
Oh. :S That makes it slightly more complicated. I guess the best thing there is just to 1-->Blah:1-->Etc everything.
which is what I do (you act like I am stupid here)
Laughing No, I was just trying to think of an optimized way to do it. Smile
If only this would work:
Code:
For(A,1,10
1 -> expr(sub("BCDEFGHIJK",A,1
End
Idea Idea Idea Idea Idea Idea



Code:

1 -> L1(expr(sub("BCDEFGHIJK",A,1


if it works Im a genius
ZOMG! I bet it would...
now I have to test that....and I hope I get credit for thinking of it.

Ive been having fun working with expr( on my frog game
expr( is one of the most powreful and least used of TI-BASIC commands.
IT WORKS!!!!! Good Idea Good Idea Good Idea Good Idea Good Idea

If dim(L1, of course...

So can you give an example of how to use it? I'm curious about it's potential...
How does that work exactly?
1 -> L1(expr(sub("BCDEFGHIJK",A,1


first, sub picks out the variable you wish to use based on the value of A.
Then expr( evaluates the substring to find the index in the list that you will store too.
I still don't see how it saves space. Razz
Wouldn't that be like
1-->L1(B
1-->L1(C

instead of
1-->B
1-->C?
no, because it allows you to choose which variable to use to store to based on A instead of brute forcing it with If statements.
I still don't quite see that, but I'll take your word for it. Smile
you have a bunch of variables that contain list indices. You want to pick which variable to use based on the value of A.

you could either do this:


Code:

1 -> L1(expr(sub("BCDEFGHIJK",A,1


of


Code:

If A = 1
1->L1(B
If A = 2
1->L1(C
If A = 3
1->L1(D
If A = 4
1->L1(E
If A = 5
1->L1(F
If A = 6
1->L1(G
If A = 7
1->L1(H
If A = 8
1->L1(I
If A = 9
1->L1(J
If A = 10
1->L1(K


now do you see the space it saves?
That's what I thought it did. Fair enough. But I thought we were looking for something to do:
1-->A
1-->B
1-->C....
right. but if at the start of the program you do:

Code:

10->dim(L1
1->A
2->B
3->C
4->D
5->E
6->F
7->G
8->H
9->I
10->J


you're set Very Happy
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 4
» All times are UTC - 5 Hours
 
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

 

Advertisement