Omnimaga
Calculator Community => TI Calculators => Axe => Topic started 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.
-
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.
-
Did you save that command into a variable besides Y1? Did you save it into another variable?
EDIT: Ninja'd.
-
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.
-
Oh wait i read your command wrong. Hmmm this sounds like a bug. its supposed to be 0 if its in Ram
-
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.
-
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)
-
oh! with "FILE" you mean Y0-Y9? nice to know! :D
-
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.
-
Is this for the contest, by the way? If not, you could maybe post source code of what you are trying to do.
-
Quigibo, could this possibly be because you're trying to skip the archived VAT entry even if the variable is in RAM?
-
Is this for the contest, by the way? If not, you could maybe post source code of what you are trying to do.
:.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)