BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
ih

Community Trekker

Joined:

Sep 30, 2016

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

Joined:

Jun 22, 2012

Solution

Re: Variable scope unexpected result

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

Jim
1 REPLY 1
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: Variable scope unexpected result

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

Jim