[TIB] Re: Question


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

[TIB] Re: Question




Ah, I see what you want. I think that a list would do exactly what you 
want. Basically, a list is a bunch of variables that have an index 
[which is what you were trying to use "X" to represent].

If you know exactly how many different variables that you want, then 
your code should look like this:

:[number of variables you want]->dim(L1)
:[begin loop]
:X+1->X
:Y->L1(X)
:[end loop]

Do NOT use Goto / Lbl loops in TIBasic. These commands are really poorly 
suited for looping, as they lead to memory leaks and other problems, not 
to mention they are much slower than a Repeat( or For(. In general, try 
to avoid using Goto / Lbl commands in TIBasic at all costs, they really 
aren't very well implemented, and are often used improperly.

-c.j.w.

Jules Kahn wrote:
> Thank you for your answer, but I don't think I expressed my question 
> correctly. What I wanted to do was something more like this:
> lbl s
> X+1-->X
> Y-->A"X"
> goto s
> 
> I would want something like this to produce a bunch of variables named A1 A2 
> A3 A4... without expressly writing A3 or A4 in the code itself. Is this 
> possible?
> 
>>From: Stephen Beck <nolekid@bellsouth.net>
>>Reply-To: ti-basic@lists.ticalc.org
>>To: ti-basic@lists.ticalc.org
>>Subject: [TIB] Re: Question
>>Date: Thu, 7 Nov 2002 15:37:34 -0500
>>
>>
>>I have no idea if this is possible, but you could try Y->A->X, and it will 
>>set both A and X to Y.
>>
>>
>>>From: robvanwijk@gmx.net
>>>Date: 2002/11/07 Thu AM 10:36:07 EST
>>>To: ti-basic@lists.ticalc.org
>>>Subject: [TIB] Re: Question
>>>
>>>
>>>
>>>>Hello, everyone.
>>>>I'm new to this mailing list, and to coding in general,so I would like 
>>>
>>to
>>
>>>>ask you all to bear with me.
>>>>I would like to set a number of variables using only one line of code.
>>>>Something like
>>>>X+1-->X
>>>>Y-->A"X"
>>>
>>>You want to do Y->A and Y->X at the same time? I'm not completely
>>>sure about the 86, but I know for a fact it is not possible on the 83.
>>>Also, I never heard of a syntax like that, not for any calc. So I guess
>>>you'll be stuck with the multiple-commands-on-a-line, colon-seperated
>>>method.
>>>
>>>Grtz,
>>>Rob van Wijk





Follow-Ups: References: