Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hi there,
Using mathcad 15, how to undefine the built in "L" and "ton"?
I want my formula's wich are using L and ton to indicate an error when if variables are incorrectly used. This will help me to improve the quality of my sheets.
Best regards,
Frank
Solved! Go to Solution.
Using mathcad 15, how to undefine the built in "L" and "ton"?
I want my formula's wich are using L and ton to indicate an error when if variables are incorrectly used. This will help me to improve the quality of my sheets.
I am absolutely clueless as of what kind of error checking you would like to implement and why you would need L and ton to be treated as undefined variables.
But if your intention really is to undefine L and ton as you demanded, you could do it by assigning L and ton an expression which fails when its evaluated. In the examples below I have chosen a divison by zero for L and a nonexisting variable in case of ton. If this solves your problem, you may put those assignments in a collapsed area so its out of way.
The only way to do that is to set the unit system to "none", which would disable all units.
is it necessary to use these names exactly? or could you change to a subscripted form
(say) t.on which will display as
and similarly L could be L1 or L_ or L.name.
{{{Note that L. will work but WILL be very confusing as it will display as just L }}}
If you want to use units (and I prefer to use them where possible as it has saved me a few mistakes that could have cost hours to trace) then longer names tend to be advisable
Regards
Andy
Using mathcad 15, how to undefine the built in "L" and "ton"?
I want my formula's wich are using L and ton to indicate an error when if variables are incorrectly used. This will help me to improve the quality of my sheets.
I am absolutely clueless as of what kind of error checking you would like to implement and why you would need L and ton to be treated as undefined variables.
But if your intention really is to undefine L and ton as you demanded, you could do it by assigning L and ton an expression which fails when its evaluated. In the examples below I have chosen a divison by zero for L and a nonexisting variable in case of ton. If this solves your problem, you may put those assignments in a collapsed area so its out of way.
That looks like a very odd request indeed. Quite funnily, on a day where we were mentioning the issue of Mathcad Prime not preventing us from redefining/undefining pre-defined variables and functions...
I would certainly never recommend to undefine or redefine pre-defined variable, and units even less (although I did take some liberties with this rule, regarding imperial units, but apart from Americans, British and crazy people, who chooses to use those anyway ?). Using units everywhere where possible is the first line of defense against errors and typos.
Like any rule, it can be broken when one knows what he is doing, but from my little experience, it causes lots of problems more often than not...
Thanks WE. The eror checking works now.