Start a topic
With the exception of Windchill, The PTC Community is on read-only status until April 6 in preparation for moving our community to a new platform. Learn more here
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community is on temporary read only status in preparation for moving our community to a new platform. Learn more here

Translate the entire conversation x

IF OTHERWISE RETURN VS IF ELSE RETURN

EC_14511170
1-Visitor

IF OTHERWISE RETURN VS IF ELSE RETURN

I used the MCD converter to convert an old worksheet. The converter changed a conditional statement from IF-OTHERWISE-RETURN to IF-ELSE-RETURN. It stated the results are still accurate, but that is not entirely the case. I don't know how to change it back to the original conditional statement. Is there a way to change it?
2 REPLIES 2
LucMeekes
23-Emerald IV
(To:EC_14511170)

Sure , there is a way to change it. But. regarding such branching:
• Mathcad supports only IF and OTHERWISE

• Prime supports IF, ELSE, ELSEIF and ALSOIF.

(In all cases a 'THEN'  is implied between the condition and the statement at the end of the line.)

Note that I do not consider RETURN as part of an IF... branch. RETURN provides its argument (whatever follows it) as an unconditional result of the function. It can be used as an expression in an IF construct, but also in a WHILE or FOR construct, and (preferably) at the (normal) end of the function.

 

I would assume that ELSE is a correct replacement of OTHERWISE, but it may depend on the structure of your program. Can you post the file(s) or at least the snippets, both from Mathcad and Prime?

 

Success!
Luc

Hi @EC_14511170,

 

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation. 

 

Thanks,
Anurag 

Announcements

Top Tags