Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
A simplified example probably illustrates my question best:
I would like to set multiple variables based on the value of A in my example above.
Thanks,
Kevin
Solved! Go to Solution.
You're using the 'equals' operator "=" where you should use the assignment operator for programs "<-".
So do like this:
You use:
to test if A equals the string "Value1". The result is either True (nonzero) or false (zero).
You use:
to assign a value of 3 to the variable x, outside of programming.
Inside of a program, the assignment should look like:
Success!
Luc
You're using the 'equals' operator "=" where you should use the assignment operator for programs "<-".
So do like this:
You use:
to test if A equals the string "Value1". The result is either True (nonzero) or false (zero).
You use:
to assign a value of 3 to the variable x, outside of programming.
Inside of a program, the assignment should look like:
Success!
Luc
Kevin Wadley wrote:
A simplified example probably illustrates my question best:
I would like to set multiple variables based on the value of A in my example above.
Luc's answer is the correct one. Here's another way of assigning values en masse that I sometimes use to make a program more visually compact. Given that Mathcad can do calculations inside an array, you can also use a variant of this method to attach comments to an expression (to ensure they remain aligned).
Stuart
Luc & Stuart-
Thank you for the reply, but I'm still not exactly there.
I want to use my results of my IF statement outside of the program, so I need to define multiple variables outside the program as well.
For example, I need to define variables X, Y, & Z from the results of my program:
where X = x+y+z
Y = 2x
Z = 4y
Thanks again,
Kevin
Maybe that way:
You may also consider turning the routine into a function with A as argument.
WE
Thanks all!
I thought you might like to see my final program:
Comments are appreciated if you see something I could do better.
Kevin