declare var general

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
mromero
Posts: 3
Joined: 24 Jan 2023, 02:38

declare var general

Post by mromero »

I need to declare a var somewhere in axes that I can use your content anywhere
User avatar
Dino
Posts: 88
Joined: 19 May 2017, 08:29

Re: declare var general

Post by Dino »

Hi

You can add your variable in USERENV like this:
axesuserenv01.jpg
axesuserenv01.jpg (213.05 KiB) Viewed 10888 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'
Post Reply