Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hello
I am using advanced control text box with python to do conditional formatting. Unfortunately if the variable is undefined I cannot reset the formatting to warn the user something is wrong with the control which results in previous value being displayed. Is there any way to to change the text string/background color in case any variable is undefined?
My code below:
Thank you
Best regards
Michal
Solved! Go to Solution.
As far as I am aware there is no way to automatically determine if a variable is defined and act accordingly.
But it sure would be a nice to have.
You may consider to post a feature request at PTC support or an "idea" here -> Mathcad Ideas - PTC Community
As far as I am aware there is no way to automatically determine if a variable is defined and act accordingly.
But it sure would be a nice to have.
You may consider to post a feature request at PTC support or an "idea" here -> Mathcad Ideas - PTC Community
Thank you for the reply.
I agree that it is somewhat critical to know if the variable is undefined in the scripts.
Do you know what happens if the variable is undefined? Is the script in the control widget not executing at all?
Unfortunately it seems like I do not have access MathCad Ideas part of the forum so I cannot post it.
Do you know what happens if the variable is undefined? Is the script in the control widget not executing at all?
I don't know for sure but I guess that a scripted control is seen as a math region and so isn't evaluated at all if an undefined variable is used as input.
