Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Link on August 30, 2012, 01:27:44 pm

Title: Question about usage of the GetCalc() command.
Post by: Link 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?
Title: Re: Question about usage of the GetCalc() command.
Post by: Yeong 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. :)
Title: Re: Question about usage of the GetCalc() command.
Post by: Deep Toaster 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.
Title: Re: Question about usage of the GetCalc() command.
Post by: Link on August 30, 2012, 01:38:01 pm
Okay, thanks mate. Appreciate it!
Title: Re: Question about usage of the GetCalc() command.
Post by: Hayleia 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 ;)
Title: Re: Question about usage of the GetCalc() command.
Post by: Deep Toaster 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.)