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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Translate the entire conversation x

Mathcad 15 - Invalid syntax error

NH_14443695
2-Explorer

Mathcad 15 - Invalid syntax error

Hello,

I'm trying to make an "If" statement on Mathcad 15 that is able to pull a value for Alpha based on the Exposure Category assigned (B, C or D). I did this on Mathcad Prime (see snip) but having problems replicating it on Mathcad 15. I defined exposure earlier as " E = "B", but when i try to type the if statement it says "Cannot understand this syntax". Any help is appreciated, Thanks!

NH_14443695_0-1766421393289.png

 

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

So why don't you post the part of the Mathcad 15 sheet you experience troubles with so we can see what you are doing wrong?

Due to a forum bug its necessary to put the file in a zip archive and upload this archive.

In case you get the name f the archive twice when you do so, delete the one shown in light gray so that the  "Post" button is enabled.

 

Note that you can't simply type "if" or "otherwise" but you have to use the appropriate keyboard shortcuts or use the "Programming" palette. (menu "View - Toolbars - Programming")

Werner_E_3-1766437044872.png

 

 

Here are a few possible implementations.

As a program should return something in any case I added a return string in case variable Exposure id different from "B", "C" or "D".

The versions using "lookup" will throw an error in case "Exposure" is invalid, while the last variant will return 0 in that case.

Werner_E_2-1766436484337.png

 

I guess that the version clearest to a reader might be the second one which takes advantage of the fact that a program is terminated when it encounters a "return" statement.

 

Announcements

Top Tags