Skip to main content
1-Visitor
October 4, 2021
Solved

Running a check statement using If/then, variable undefined

  • October 4, 2021
  • 2 replies
  • 2805 views

Hi all,

 

I'm currently trying to run a quick check on my Mathcad worksheet that populates a "Yes" or "No" to validate whether the section modulus value is above the required one.  When I place the yes and no variables in the program it says they're undefined.  I switched them to the "keyword" label in hopes that would remedy my situation, but unfortunately I have the same issue.  Attached is a snippet of what I currently have in the worksheet.  Please let me know your thoughts.  Thanks!

Best answer by SA_10030091

This worked great!  Thanks Stuart!

2 replies

23-Emerald V
October 4, 2021

@SA_10030091 wrote:

Hi all,

 

I'm currently trying to run a quick check on my Mathcad worksheet that populates a "Yes" or "No" to validate whether the section modulus value is above the required one.  When I place the yes and no variables in the program it says they're undefined.  I switched them to the "keyword" label in hopes that would remedy my situation, but unfortunately I have the same issue.  Attached is a snippet of what I currently have in the worksheet.  Please let me know your thoughts.  Thanks!


 

Have you defined Yes and No?  If not, just put your Yes and No in quotes.

 

Although it would sometimes be useful for Mathcad's numeric engine to return the name of an undefined variable, Mathcad treats undefined variables as an error.

 

If you used Mathcad's symbolic engine, then Mathcad would return the names of undefined variables (it treats them as just symbols).  However, there is normally a performance penalty to pay for using the symbolic engine (it can be quite slow) and it won't do everything the numeric engine will.

 

Here's an example using defined variables.

 

2021 10 04 A.png

 

Stuart

SA_100300911-VisitorAuthorAnswer
1-Visitor
October 4, 2021

This worked great!  Thanks Stuart!

21-Topaz II
October 4, 2021

Hi,

I ask the question a little differently as it is easier to understand like this.

Capture.JPG

Cheers

Terry