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

Problems with global definition

SOLVED
LemnosOreoda
Participant

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?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Problems with global definition

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

Re: Problems with global definition

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.

 

Re: Problems with global definition


@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.

Re: Problems with global definition

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

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."