Re: TIB: lots of help needed
[Prev][Next][Index][Thread]
Re: TIB: lots of help needed
>
> That was a basic trick to save memory. Type "1==1" on the homescreen.
> then type "2==1". It will give you 1 if the statement is true and 0 if it is
> false. All "if" does is check to see if the result is 1 or more. If it is, it
> runs
> the next line (or then statement). So "If exist[1]" will run the next line if
> exist[1] is 1 or more and skip it (or the then statement) if it is 0 or less.
> Now that I think about it, I don't remember what it does between 0 and 1.
>
>
Basically, the calc views a 0 as a 0, and EVERY OTHER NUMBER as 1. It
also views the 0 as false and a 1 as true. This means that if you have
:If 1
:Disp "JODY
the calc wil ALWAYS display my name because 1 is ALWAYS true.
Likewise;
:If 0
:Disp "JODY
will NEVER display my name because 0 is NEVER true. With the same
idea, if you wanted to display something only when a variable is not
zero you would probably have done this;
:If N<>0
:Disp "JODY
But this can be simplified to only;
:If N
:Disp "JODY
If N _does_ equal zero, the calc sees a :If 0 (which is false) and
does not display jody. However, if the calc is any other number (not
zero!) then it will see :If 1, which IS true, and disp my name. Get
the idea?
If you're interested in learning this in much more detail I highly
recommend a series of articles written by Frank Force and displayed at
TI-Philes. That's where I learned about it. The article is "Advanced
TI-82 Programming", but it is the same idea for the 85. Highly
recommended viewing...
Jody Snider
jody1@alaska.net
References: