Re: TIB: Back to TI-BASICs


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

Re: TIB: Back to TI-BASICs




Peter Sahlstrom wrote:
> 
> On the TI-82/83 if you check for a variable (for example, Theta) and it
> doesn't exist, it will return the value as 0.  On the 85/86, if you check for
> a variable and it doesn't exist, it will return an error.  Spacefight on the
> TI-82 uses this feature so that if you run one of it's subroutines without
> going through the main program it will tell you what the subroutine is for.
> Spacefight is available in the ticalc.org TI-82 BASIC archives.  I, however,
> use a TI-86 (formerly an 85) and I can't check for a variable if it doesn't
> exist.  I did find a way around this by using lists.  This way you can have
> subroutines display help information if you run them directly.  It is also
> helpful if you want to keep a high-score table-it won't give an error if the
> variable doesn't exist.  If anyone is interested in this program, I can send
> it to you.
> 
> -Peter
> 
> Jody wrote:
> 
> > >  and dangerous
> > > because I have often deleted essential parts of programs.  An easy
> > > solution would be to do something like in Spacefight for the TI-82 (same
> > > process would work for the '83) where subroutines check for the Theta
> > > variable, and if it equals 0, it displays an error message.
> >
> > I'm curious what this means? I've never heard about checking for @ and
> > displaying error messages. Just what does the calc do? Why would it
> > display an error?
> >
> > Jody Snider
> > jody1@alaska.net

That's not entirely correct. On the 82/83 the calc will return an 
error if the variable doesn't exist. It will only return a 0 if that 
value is in fact a 0. I think. I've found that storing an oddball 
variable (I like to use the letter O) to a very odd number (something 
that is VERY unlikely to just happen; I like to use something like 
386) works better. I've never used this to display an program error 
message, but this will work to seperate input data. A good example is 
the quadratic formula. I wrote my own version that is tied in with a 
radical simplifier to give answers in the -b+-SQRT(b^2....form. If the 
quad program is running the radical program needs to just take the 
number it's given, however, if the radical program is run seperately 
it needs to have the user input the number to be simplified.

Jody Snider
jody1@alaska.net


References: