Page 1 of 1

declare var general

Posted: 28 Jul 2023, 01:37
by mromero
I need to declare a var somewhere in axes that I can use your content anywhere

Re: declare var general

Posted: 01 Aug 2023, 08:09
by Dino
Hi

You can add your variable in USERENV like this:
axesuserenv01.jpg
axesuserenv01.jpg (213.05 KiB) Viewed 10891 times

Code: Select all

/* <--- Note the comma */ 
   /* ------------------------------------------------ */ 
   OneGeneralVariable : "",       /* One general variable everyone can access */
   /* ------------------------------------------------ */ 
then when you want to assign a value in your script just use:

Code: Select all

USERENV.OneGeneralVariable = "Hello";
and when you want to read it just access USERENV.OneGeneralVariable, for example:

Code: Select all

alert(USERENV.OneGeneralVariable);
USERENV.OneGeneralVariable = 'Bye'