A92: Re: Programming


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

A92: Re: Programming




>
>This is just a Basic question, but l dont have a TI-92 so l can't find out.
>When l do #A to run a program name stored in it does A have to be "Program"
or
>"Program()" ?


First things: This is a list for assembly-related questions only.  I believe
there is a list for TI-92 Basic.

An Answer Anyway: The indirection operator (#) simply takes the indirection
string and turns it into whatever VARIABLE was specified.  Here is an
example of using indirection correctly and incorrectly.
+----------------------------------------------------------------------+
| Define y1(x)=x^2                                                Done |
| "y1"->a                                                         "y1" |
| #a                                          Error: Too few arguments |
| #a(x)                                                            x^2 |
| #a(4)                                                             16 |
| "y1(x)"->a                                                   "y1(x)" |
| #a            Error: Indirection string is not a valid variable name |
+----------------------------------------------------------------------+
You can only put "VARIABLE" into a string.  Now if you wanted, you could use
the expr() command to evaluate a string containing more than just the
variable.  However, the expr() attempts to EVALUATE the string.  The
indirection operator is handy for using variables like pictures.  The
pictures can't be evaluated like expressions, but often it is nice to work
with them in a program.
+----------------------------------------------------------------------+
| Define y1(x)=x^2                                                Done |
| "y1"->a                                                         "y1" |
| expr(a)                                     Error: Too few arguments |
| "y1(x)"->a                                                   "y1(x)" |
| expr(a)                                                          x^2 |
| expr(a)|x=4                                                       16 |
+----------------------------------------------------------------------+
I hope this answers your question.

====
Aaron Hill (mozart@inlink.com)
IRC Nickname on EF-Net: SeracOhw
http://www.inlink.com/~mozart/i3/