# Omnimaga

## Calculator Community => TI Calculators => Axe => Topic started by: boot2490 on March 03, 2012, 05:43:57 pm

Title: Appvars, and referring to a certian point in one?
Post by: boot2490 on March 03, 2012, 05:43:57 pm
Currently, I am using OS lists, so they are extremely large. I would like to use an appvar instead, to save space. So basically, I want to store a list in an appvar, and through AXE, refer to a certian entry in that "list" to be used in calculations. Is this possible?
Title: Re: Appvars, and referring to a certian point in one?
Post by: leafy on March 03, 2012, 05:44:47 pm
To create an appvar, use

GetCalc("appvNAME",SIZE)->POINTER

Then to access bytes of that appvar, use:
{POINTER+ENTRY}

check out the axe manual for more stuff on that.
Title: Re: Appvars, and referring to a certian point in one?
Post by: Builderboy on March 03, 2012, 05:44:58 pm
When you say you want to store a list in an appvar, do you mean you want to store TiOS List's inside of an appvar, or just store a list of 16bit numbers in an appvar?
Title: Re: Appvars, and referring to a certian point in one?
Post by: boot2490 on March 03, 2012, 05:57:25 pm
I want to store numbers, in sequence, to be reffered to later, but without filler like in OS lists.
Title: Re: Appvars, and referring to a certian point in one?
Post by: Builderboy on March 03, 2012, 05:58:44 pm
Then leafy's code should do what you want.  To access an Appvar that has already been created, just do:

Code: [Select]
`GetCalc("appvName")->Pointer`
Title: Re: Appvars, and referring to a certian point in one?
Post by: boot2490 on March 03, 2012, 07:19:52 pm
so the pointer is a number? and the appvar name can be typed in?
so, in
Quote
GetCalc("appvarNAME",SIZE)->POINTER

Then to access bytes of that appvar, use:
{POINTER+ENTRY}

I would type:
GetCalc("appvarAXELIST",20)->1
wait, what is pointer+entry? I'm still confused.
Title: Re: Appvars, and referring to a certian point in one?
Post by: Builderboy on March 03, 2012, 07:25:38 pm
You wouldn't type in 'appv', as that is a token you get access to by pressing [2nd] and then [8].  GetCalc() is a command that returns a pointer, where that pointer is the location of the start of the appvar.  Your code would look something like this to create the Appvar.

Code: [Select]
`GetCalc("appvAXELIST",20)->P`
The variable P now holds the location of the start of the appvar.  To access the first byte of the appvar, you would do

Code: [Select]
`{P}`
To access the second byte of the appvar, you would do

Code: [Select]
`{P+1}`
And so on
Title: Re: Appvars, and referring to a certian point in one?
Post by: C0deH4cker on March 03, 2012, 08:26:29 pm
How big do you want your numbers to be? If you only want them to be between 0-255, You can hold one number per byte. Otherwise, you will need 2 bytes per number (0-65535).

154->{P+12} will store the number 154 to the 13th byte in your appvar.
24479->{P+17}r will store the number 24479 to the 18th and 19th bytes in your appvar. The superscript 'r' tells axe to save the number as 2 bytes.