A89: Re : yet another


[Prev][Next][Index][Thread]

A89: Re : yet another



Title: Re : yet another
>here i go again. late night BASIC programming! =)
>anyway, i'm sorry to be "flooding" this Assembly list with BASIC questions,
>but
>since it's 89 specific i figured what the heck. (i know that my questions
>probably pertain to all TI-8x calcs, but again, what the heck!)
>
>i'm going through a for statement
>for test,1,40,4
>endfor
>
>each time it does that it'll store 1,5,9,13 . . . into test. but each
>time, it
>overwrites it.
>how do i store each answer into a variable of it's own in the for statement?
>
>i thought i could set a variable to 1 maybe
>1->s
>then have
>for test,1,40,4
>test->test(s)
>1+s->s
>endfor
>but that doesn't work. so, hopefully that example will give you some idea of
>what i'm trying to do.
>thanks for the help. (even though i haven't gotten any responses to the last
>two posts! i'm hoping it's because everyone is asleep)
>
>later.
>{-
Hi, don't panic i'm gonna answer to you, i think i'm gonna save you (if possible)
if you want to store values from x to y going by z each time in the var list for example, you should do like that:
There are two diferent ways, the first one is the one U seemed to be trying to do:
first way (not really efficient):

{}->list
0->n
for i,x,y,z
1+n->n
i->list[n]
endfor
second way, this is tinier, smarter, simpler and better programming, so U have no choice! :-)
{}->list        -- init the list (can be replaced by []->list, if you want a matrice)
for i,x,y,z
augment(list,{i})->list
endfor
Actually there is an other way, a mathematical way in only one line of code, which is for me better, but I just can't remember it for now, and i don't have the time to think about it for now. If you really want to know about it, just Email me later, sure i'll answer.
By the way, be proud, BASIC programming is very powerful, U can do a lot of things. I did games, and even a Program Manager (PGL2.0, can be found on http://www.ticalc.com), pretty efficient.

Bye, CedFoo (Cedric Vidal from Paris, France) cedfou@chez.com