BookmarkSubscribe
Choose Language Hide Translation Bar
antoinesofradir
Community Trekker

[JSL] Recover variable value from another script

Hello !

In my first Script i defined a variable ... I would like now to recover this variable in my second Script :

How can i do ?

this example show my problem:

First Script :

Variable = 1 ;

Include("C:\Second Script.jsl");

Second Script :

If( Variable ==1, Data Table ... )

Thanks for your help !

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: [JSL] Recover variable value from another script

If you aren't using namespaces or "names default to here(1)" then all variables will be global.

If you are using namespaces or names default to here(1), then if you preface the variable with two colons it will be treated as a global variable.

First Script :

::Variable = 1 ;

Include("C:\Second Script.jsl");

Second Script :

If( ::Variable ==1, Data Table ... )

0 Kudos
2 REPLIES 2
pmroz
Super User

Re: [JSL] Recover variable value from another script

If you aren't using namespaces or "names default to here(1)" then all variables will be global.

If you are using namespaces or names default to here(1), then if you preface the variable with two colons it will be treated as a global variable.

First Script :

::Variable = 1 ;

Include("C:\Second Script.jsl");

Second Script :

If( ::Variable ==1, Data Table ... )

0 Kudos
antoinesofradir
Community Trekker

Re: [JSL] Recover variable value from another script

Merci beaucoup !

0 Kudos