Re: TIB: program speed


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

Re: TIB: program speed




If C=2
Q+1->Q
Is correctly written:
Q+(C=2)->Q
If C is 2 then Q will increase by 1
IF C is not 2 then Q will increase by 0
This works if you only want to add 1 to a variable, nothing else.
This IS the fastest way to optimize If statements and faster than the 
'normal' way.


Jody wrote:
> 
> This is a little difficult to explain, but here goes...
> I read a while ago about using the calcs ability to test logic
> statements to combine lines of code. For example, instead of this;
> :If C=2
> :Q+1->Q
> 
> you could do this;
> :Q+(C=2->Q
> 
> and save a little memory. Well, in my program that I'm working on
> right now, I have several of these situations located within in one
> loop. Using the second example, Q+(C=2->Q, the calc will do this every
> time it goes through the loop. However, would it be FASTER (albeit
> bigger) to use the top example, If C=2 Q+1->Q. I guess in short, does
> the calc look at a command if the logic statement is false. If C<>2,
> does the calc look at the Q+1->Q, or does it quickly skip over it?
> 
> Jody Snider
> jody1@alaska.net


Follow-Ups: References: