Author Topic: Accessing AppVar  (Read 8615 times)

0 Members and 1 Guest are viewing this topic.

Offline nitacku

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 300
  • Rating: +30/-1
  • ni-ta-ku ^_^
    • View Profile
Accessing AppVar
« 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.
« Last Edit: August 31, 2010, 04:02:35 pm by nitacku »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Accessing AppVar
« Reply #1 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.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Accessing AppVar
« Reply #2 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.
« Last Edit: August 31, 2010, 04:12:09 pm by Raylin »
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline nitacku

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 300
  • Rating: +30/-1
  • ni-ta-ku ^_^
    • View Profile
Re: Accessing AppVar
« Reply #3 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.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Accessing AppVar
« Reply #4 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

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Accessing AppVar
« Reply #5 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.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Accessing AppVar
« Reply #6 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)
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Accessing AppVar
« Reply #7 on: August 31, 2010, 06:10:02 pm »
oh! with "FILE" you mean Y0-Y9? nice to know! :D
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline nitacku

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 300
  • Rating: +30/-1
  • ni-ta-ku ^_^
    • View Profile
Re: Accessing AppVar
« Reply #8 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.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Accessing AppVar
« Reply #9 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.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Accessing AppVar
« Reply #10 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?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline nitacku

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 300
  • Rating: +30/-1
  • ni-ta-ku ^_^
    • View Profile
Re: Accessing AppVar
« Reply #11 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, © 2005-2010 Cemetech
« Last Edit: September 01, 2010, 04:09:14 pm by nitacku »