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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Problems with global definition

LemnosOreoda
10-Marble

Problems with global definition

Hi ptc community, I would like to make the following arrangement:

 

c="aply"

a:5

b:3

cif(a>b,"aply","does not aply")

 

Is there any way to place a result of verification of several variables before said verification?

 

I know that the global definition makes two passes: in the first pass, it evaluates only the global definitions and dismisses all the regular definitions but it would not be great if in the first pass it evaluates the global definitions taking into account the regular definitions that are before this global definition so that in the second pass not have this problem?

 

 

 

ACCEPTED SOLUTION

Accepted Solutions

FredKohlhepp thank you for your response but what I am looking for is to place the result at the top.

 

Werner_E thanks for your response, well it seems that it is not possible in this version thanks anyway

View solution in original post

3 REPLIES 3

May I suggest using a function:

FredKohlhepp_0-1576517229354.png

That way you have a reusable test.  Global variables should be avoided when possible and used sparingly.

 


@LemnosOreoda wrote:

Hi ptc community, I would like to make the following arrangement:

 

c="aply"

a:5

b:3

cif(a>b,"aply","does not aply")

 

Is there any way to place a result of verification of several variables before said verification?

 

I know that the global definition makes two passes: in the first pass, it evaluates only the global definitions and dismisses all the regular definitions but it would not be great if in the first pass it evaluates the global definitions taking into account the regular definitions that are before this global definition so that in the second pass not have this problem?

 

 

 


As you have found out yourself, the global definition can only be used with constants, so what you tried must fail.

There is no way to put results on top (maybe with the exception of scripted components which are available in Mathcad 15 an below, but not in Prime).

One way I could think of is to hide the calculation in a collapsed region so it just looks like the worksheet starts with the results.

FredKohlhepp thank you for your response but what I am looking for is to place the result at the top.

 

Werner_E thanks for your response, well it seems that it is not possible in this version thanks anyway

Announcements

Top Tags