Author Topic: Appvars, and referring to a certian point in one?  (Read 4862 times)

0 Members and 1 Guest are viewing this topic.

Offline boot2490

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 607
  • Rating: +54/-36
    • View Profile
    • Boot2490's Stuff
Appvars, and referring to a certian point in one?
« 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?
I'm not worried about SOPA creating censorship, that will not stand for long. I'm worried that they'll succeed in stopping piracy!

Spoiler For Signature, updated march 23, 11:28 PM EST:















An useful tool!

PM me if you need some help. I am glad to be of assistance and part of the TI Communnity.

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Appvars, and referring to a certian point in one?
« Reply #1 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.
« Last Edit: March 03, 2012, 05:51:22 pm by leafy »
In-progress: Graviter (...)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Appvars, and referring to a certian point in one?
« Reply #2 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?

Offline boot2490

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 607
  • Rating: +54/-36
    • View Profile
    • Boot2490's Stuff
Re: Appvars, and referring to a certian point in one?
« Reply #3 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.
I'm not worried about SOPA creating censorship, that will not stand for long. I'm worried that they'll succeed in stopping piracy!

Spoiler For Signature, updated march 23, 11:28 PM EST:















An useful tool!

PM me if you need some help. I am glad to be of assistance and part of the TI Communnity.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Appvars, and referring to a certian point in one?
« Reply #4 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

Offline boot2490

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 607
  • Rating: +54/-36
    • View Profile
    • Boot2490's Stuff
Re: Appvars, and referring to a certian point in one?
« Reply #5 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.
I'm not worried about SOPA creating censorship, that will not stand for long. I'm worried that they'll succeed in stopping piracy!

Spoiler For Signature, updated march 23, 11:28 PM EST:















An useful tool!

PM me if you need some help. I am glad to be of assistance and part of the TI Communnity.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Appvars, and referring to a certian point in one?
« Reply #6 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

Offline C0deH4cker

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 258
  • Rating: +11/-1
    • View Profile
    • iNinjas Forum/Repo
Re: Appvars, and referring to a certian point in one?
« Reply #7 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.