Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: XiiDraco on December 18, 2012, 03:19:34 am
-
I have hit a variable limit and was wondering if there was anything to get around that. I know in Ti-BASIC you can just create a list and store things to that, but I do not know how to to such things while using axe parser.
Can I get some help please? Thanks.
-
There are variable limits in Axe? O.O Did you get any error stating so? I was sure that Axe could let you use as many vars as your RAM do
-
I am refering to A-Z and ø. Now what do I use...
-
You can use any free ram space, or if you're using a program you can even make your own spaces!
A-Z and theta are just locations in memory that have predefined names. L1 (768 bytes), L2 (531 bytes, but actually bigger), L4 (256 bytes), and L5 (128 bytes) are pointers to other areas of memory that are usually free to use.
-
What squidgetx said. Look at the Commands.html, find a RAM area that none of your lines of code will corrupt (for example, don't use L5 if you use ClrHomes in your code), then create new variables like this:
L5→°Var1
L5+2→°Var2
L5+4→°TheGame
Now, Var1, Var2 and TheGame are legit variables, like A, B and so on, you can do 1→Var1, etc.
(note that TheGame has a name length above 5 so it will only work on 1.2.0 and higher).
-
Im afraid i don't fully understand...
-
Im afraid i don't fully understand...
??? What didn't you understand ?
-
/me lost, darn you, Evil Absol!
-
If you only need 6 more variables, you can press VARS, go right to Y-VARS, Polar..., and then you can use R1 through R6 just like you would any other variable.
If you need more, this tutorial is what I used to understand how to use Arrays to store variables (it's pretty much like a list). It's best explained by this link, but it'll be confusing at first (was for me at first): http://ourl.ca/9288
Also, if you want to run it in MirageOS or any other OS, make sure to only use L1, not L2 or others or it will not work.
-
This is interesting. I didn't realize that you could have variables other than the prenamed ones. I've never run out of the variables, but it would be nice to have meaningful names.
However I can't get it to work. I have this code:
PROGRAM:ΘTEST
.TEST
L₅→°FOO
L₅+1→°BAR
5→FOO
6→BAR
Disp FOO+BAR▸Dec
Which should display 11, but instead it displays 1547 (YMMV)
Am I missing something? Are you sure this is valid (it compiles, but maybe it means something else, though I can't think of what)?
-
Variables in Axe are two bytes large, and you only allocated FOO and BAR to be one byte apart. The second byte of FOO overlaps the first byte of BAR. :P
Two solutions:
- Allocate your custom variables two bytes apart instead of one. The standard solution.
- If you know your variables will fit in one byte each, you can keep them allocated one byte apart. All uses of the variables only allocated one byte should then be followed with a superscript r, like FOOr.
-
Ah yes, forgot that addresses point to bytes and not words, been toying with the dcpu16 architecture recently
-
How does this compile? It looks like you are defining labels at runtime, even though labels are usually resolved to constants at compile time.