Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi
Is there a function in MathCad Prime (latest version or 9) where you can put a form field in formulas?
I'll give an example:
Variable = [form field] mm
This is because I've noticed that when I make spreadsheets and make different calculation formulas, e.g.: k = x mm * y mm
so often someone accidentally removes the units, and it then completely messes up all the calculations.
So I'm looking for something similar to Excel, where each value is in its own cell. If there was a form field in the formula, other parts wouldn't be easily editable.
@WM_11132074 wrote:
Hi
Is there a function in MathCad Prime (latest version or 9) where you can put a form field in formulas?
I'll give an example:
Variable = [form field] mm
This is because I've noticed that when I make spreadsheets and make different calculation formulas, e.g.: k = x mm * y mm
so often someone accidentally remo in ves the units, and it then completely messes up all the calculations.
So I'm looking for something similar to Excel, where each value is in its own cell. If there was a form field in the formula, other parts wouldn't be easily editable.
There is no specific form in Mathcad Prime 9, although there is a close match (the TextBox) in MP10.
Stuart
Additional to what Stuart already suggested, you could (mis)use a Prime input table for just one variable.
Sure, the user could still delete the whole expression, change the variable name, etc. making the whole sheet unusable. And he still could delete or change the unit, but in this case its more unlikely that this happens accidentally as the unit placeholder is farther away from the number.
Its also easy to still provide a default value with the correct unit in front of the table.
Of course the user may think that he must type in a unit as well and if he does, radius would end up to be of dimension area instead of length.
You could trap this by using an additional assignment using the "if" function.
But of course it would never be possible to catch all errors possible. If the user inserts a non-existing unit like dm or something invalid like a text instead of a number (maybe something like 2E02 which is not seen as a valid number), the input fails but the default set in front will not be in effect anymore, so the sheet will fails.