cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

global variables

AD_10841348
4-Participant

global variables

Why am I getting an error when I move g below k? Shouldn't global variables work where ever they are used?

 

2.jpg  -->  1.jpg

 

so, this seems to work ... 3.jpg... So is it not possible to have global variables inside global variables? if so, why did the first set of calcs work?

 

 

Thank you in advance

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:AD_10841348)

When a worksheet is evaluated it is read twice. In the first scan global assignments are collected, the second run deals with the rest.

So for global definitions the same rules apply as for normal ones. The sheet is read left to right, top down. So when the global(!) definition of h makes use of the globally(!) defined constant f, then f has to be defined in front or to the left of the definition of h.

 

BTW, it has proven a good advice over the years to use global definition with great care and as sparingly as possible.

View solution in original post

1 REPLY 1
Werner_E
25-Diamond I
(To:AD_10841348)

When a worksheet is evaluated it is read twice. In the first scan global assignments are collected, the second run deals with the rest.

So for global definitions the same rules apply as for normal ones. The sheet is read left to right, top down. So when the global(!) definition of h makes use of the globally(!) defined constant f, then f has to be defined in front or to the left of the definition of h.

 

BTW, it has proven a good advice over the years to use global definition with great care and as sparingly as possible.

Announcements

Top Tags