Skip to main content
1-Visitor
December 16, 2019
Solved

Problems with global definition

  • December 16, 2019
  • 2 replies
  • 1687 views

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?

 

 

 

Best answer by LemnosOreoda

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

2 replies

23-Emerald I
December 16, 2019

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.

 

25-Diamond I
December 16, 2019

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

LemnosOreoda1-VisitorAuthorAnswer
1-Visitor
December 17, 2019

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