Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: nitacku on August 31, 2010, 03:48:30 pm

Title: Accessing AppVar
Post by: nitacku on August 31, 2010, 03:48:30 pm
So I have an appVar in RAM, and I'm trying to access it from Archive using the GetCalc("appvTEST", Y1) command. The command is supposed to return 0 since the appVar is in RAM, but it returns a large value instead. Looks like it always returns the value 16386.

Currently I'm storing GetCalc() to a pointer and checking the value of the pointer.
Title: Re: Accessing AppVar
Post by: Builderboy on August 31, 2010, 04:10:47 pm
I believe it returns 0 if the file is in Archive, not Ram.  The big number you are getting is the pointer to the appvar.
Title: Re: Accessing AppVar
Post by: Raylin on August 31, 2010, 04:11:39 pm
Did you save that command into a variable besides Y1? Did you save it into another variable?

EDIT: Ninja'd.
Title: Re: Accessing AppVar
Post by: nitacku on August 31, 2010, 04:25:30 pm
The GetCalc("appvNAME", Y1) command returns a non-zero value regardless if the appVar is archived or not.

When the appVar is archived, the command returns the correct pointer to the appVar in archive.
When the appVar is in RAM, the command returns a random value, not a pointer the appVar in RAM.
However, when the appVar doesn't exist at all, the command does return 0.
Title: Re: Accessing AppVar
Post by: Builderboy on August 31, 2010, 04:34:04 pm
Oh wait i read your command wrong.  Hmmm this sounds like a bug. its supposed to be 0 if its in Ram
Title: Re: Accessing AppVar
Post by: meishe91 on August 31, 2010, 05:15:57 pm
I thought it just returned zero if it didn't exist? I'm not an expert though, just thought I remember seeing that somewhere. Quigibo would probably know how to answer this.
Title: Re: Accessing AppVar
Post by: Quigibo on August 31, 2010, 05:50:35 pm
Mhhh.... Its actually a mistake in the documentation not the command.  You *might* be able to read file pointers from ram as well as archive, I'll have to check.  It only returns 0 if not found, it returns non-zero if it was found (although the number returned is not necessarily the pointer to the file.  The real pointer to the file is stored in the structure of Y0-Y9)
Title: Re: Accessing AppVar
Post by: LordConiupiter on August 31, 2010, 06:10:02 pm
oh! with "FILE" you mean Y0-Y9? nice to know! :D
Title: Re: Accessing AppVar
Post by: nitacku on August 31, 2010, 06:41:01 pm
Quigibo, I tried using Y1 as a pointer, but that only works when the appVar is archived (As it's supposed to).

When the appVar is in RAM ,the value Y1 holds doesn't point to the appVar.
Neither does the value returned by the GetCalc() function.
Title: Re: Accessing AppVar
Post by: DJ Omnimaga on August 31, 2010, 06:45:41 pm
Is this for the contest, by the way? If not, you could maybe post source code of what you are trying to do.
Title: Re: Accessing AppVar
Post by: calc84maniac on September 01, 2010, 11:57:24 am
Quigibo, could this possibly be because you're trying to skip the archived VAT entry even if the variable is in RAM?
Title: Re: Accessing AppVar
Post by: nitacku on September 01, 2010, 02:03:24 pm
Is this for the contest, by the way? If not, you could maybe post source code of what you are trying to do.

Quote from: Axe Code
:.AATEST
:ClrHome
:"appvTEST"→Str1
:!If GetCalc(Str1,Y1) .Check if the appVar is in ROM GetCalc() always returns a non-zero value! (unless the appVar doesn't exist)
:!If GetCalc(Str1) .Check if the appVar is in RAM
:Return!If GetCalc(Str1,7)→P .Create appVar
:Data(0,1,0,2,1,1,1)→GDB1
:For(X,0,6)
:{X+GDB1}→{X+P}
:End
:End
:Return!If ArchiveStr1
:End
:GetCalc(Str1,Y1) .Read appVar from ROM
:For(X,0,{Y1-2}r
:Disp {X+Y1}►Dec,i
:End
Generated by SourceCoder (http://sc.cemetech.net), © 2005-2010 Cemetech (http://www.cemetech.net)