Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
I am using Mathcad Prime Release 7.0 and Datecode7.0.0.0
How do i use nesting if then statements for functions? I haven't used this product in a while and can't figure out how to break out of the initial if statement to set up a second one. Is there a guide to this somewhere? can't figure out which buttons to press 😐
Not sure what the problem is.
You start creating a program by typing ] (or use the menu
Then you can add program lines by typing Shift-Enter
When you are about to insert an if-statement , just do it. You can use the menu, the keyboard short cut (deoends on your keyboard language) or, very convenient, simply TYPE "if" (without the quotes) and follow by pressing Ctrl-J.
Now you can again add lines by pressing Shift Enter and when you are about to insert the inner if-statement, do it using one of the methods described before. And again you can add lines via Shift-Enter.
To break out from the inner if-statement, you use left-arrow followed by Enter (or Shift-Enter).
Now you are in the outer for-loop again.
Documentation is the online help only.
Maybe it helps to read this section of the tutorials -> https://support.ptc.com/help/mathcad/r7.0/en/#page/PTC_Mathcad_Help%2Ftask2-1_Writing_If_Statements.html%23
EDIT: But then, maybe you don't really mean "nested" if's. So you may have a look at "also if" and "else if".
If its still unclear, you should post examples of what you would like to accomplish
There is both a function if() and a program operator if.
Note: Type the if() function i f (. do not type the program operator i f. instead insert respective Math Programming operator from ribbon.
More examples including nesting are in this Technical Support article:
do not type the program operator i f. instead insert respective Math Programming operator from ribbon.
Or you actually DO TYPE if and then press Ctrl-J. A very convenient way to insert program statements, especially given that Prime still does not provide other means like floating palettes as in real Mathcad.