Author Topic: Question about usage of the GetCalc() command.  (Read 3334 times)

0 Members and 1 Guest are viewing this topic.

Offline Link

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 152
  • Rating: +7/-3
  • Well excuse me princess!
    • View Profile
Question about usage of the GetCalc() command.
« on: August 30, 2012, 01:27:44 pm »
Okay, I created a new appvar using GetCalc like so:
Code: [Select]
GetCalc("appvTest",100)->T
In my other programs, how do I check if this App-var has already been made? Will it work by using the If command? or something else?
« Last Edit: August 30, 2012, 01:29:39 pm by The Elite Noob »

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Question about usage of the GetCalc() command.
« Reply #1 on: August 30, 2012, 01:30:05 pm »
Quote from: Axe Parser v 1.1.2 Commands
GetCalc(PTR)
Finds the object who's name is pointed to and returns a pointer to the start of its data, or zero if it was archived or not found.
I hope this helped you. :)
Sig wipe!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Question about usage of the GetCalc() command.
« Reply #2 on: August 30, 2012, 01:31:40 pm »
Yes, it's in Commands.html: GetCalc("appvTest") will return the pointer to it if it exists, else 0.




Offline Link

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 152
  • Rating: +7/-3
  • Well excuse me princess!
    • View Profile
Re: Question about usage of the GetCalc() command.
« Reply #3 on: August 30, 2012, 01:38:01 pm »
Okay, thanks mate. Appreciate it!

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Question about usage of the GetCalc() command.
« Reply #4 on: August 30, 2012, 02:25:20 pm »
Yes, it's in Commands.html: GetCalc("appvTest") will return the pointer to it if it exists, else 0.
Not exactly. It returns the pointer if it exists and if it is unarchived, and 0 if it is archived or if it doesn't exist ;)

So what you may need is something like

  UnArchive "appvTEST"
  .does nothing if the appvar doesn't exist
  GetCalc("appvTEST")->V
  !If
   GetCalc("appvTEST",100)->V
  End

To be sure it is in RAM ;)
« Last Edit: August 30, 2012, 02:25:37 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Question about usage of the GetCalc() command.
« Reply #5 on: August 30, 2012, 02:27:05 pm »
Close enough :P I always forget about archived stuff.

(By the way, you can save twelve bytes by saving "appvTEST" to Str1 or something.)