BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
ih
ih
Community Trekker

Variable scope unexpected result

In the script below, why does Show(::x) return here:x instead of global:x? I assume this is a bug but maybe I am missing something?

 

Names default to here( 1 );
fn = function( {}, ::x = 12 );
here:x = 1;
::x = 10;
fn(); //Set global variable to 12

Show(here:x);
//here:x = 1;

Show(::x);
//x = 1;

Show(1 + ::x);
//x = 13;

Show(global:x);
//global:x = 12;

Namespace("here") << Remove("x");

Show(::x);
//x = 12;
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Variable scope unexpected result

It is certainly an inconsistancy.  I suggest you pass this one to JMP Support.

Jim
0 Kudos
1 REPLY 1
txnelson
Super User

Re: Variable scope unexpected result

It is certainly an inconsistancy.  I suggest you pass this one to JMP Support.

Jim
0 Kudos