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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to write a statement in an if command in Prime

jrodriguez-9
8-Gravel

How to write a statement in an if command in Prime

How to write a statement in an if command in Prime? see ex.

5 REPLIES 5

Untitled11.png

You try to get a product of a number and a string?

2*3=6

2*"3"=?

Hi,

I guess that you need something like this ...

mathcad.png

MH


Martin Hanák
LucMeekes
23-Emerald III
(To:jrodriguez-9)

I don't suppose you want string output.

It is possible to add strings for comments to your program, but then you have to add them as separate lines. For an example see: Nested Arrays - shape function

And make sure you assign your calculation to a variable inside the program, otherwise your program might produce unexpected results.

But you could write your expression simpler, without a program (and you don't need assignment then):

Or better still:

I admit, one can argue if this makes the calculation any clearer.

In some respect it does, because it sets the (1-...) expression against 1.

Success!
Luc

I guess your goal is simply to add comments to your calculations, right?

Apart from simply placing text regions to the right of your calculations

You sure can add calculation expression with strings

or come up with something like this

but I would strongly advise against doing so!!

Best method is, as already was suggested, to add extra text lines in the program

Regards

Werner

Announcements

Top Tags