Skip to main content
1-Visitor
April 9, 2013
Solved

check if variable is defined

  • April 9, 2013
  • 2 replies
  • 5922 views

Hi,

my problem sounds rather simple but still I do not a have a solution in Mathcad. In order to automate my Mathcad 14 sheets I would like to check if a variable is defined or not.

If the variable is defined (not red colored in Mathcad) this on should be used instead of an different.

Thanks

Holger

Best answer by AndyWesterman

Richard's post may be helpful.

http://communities.ptc.com/message/128347#128347

Regards

Andy

2 replies

12-Amethyst
April 9, 2013

Richard's post may be helpful.

http://communities.ptc.com/message/128347#128347

Regards

Andy

1-Visitor
July 7, 2015

Hi Holger,

I was not able to view Richard's solution, since I cannot open .mcd files, only .mcdx. I was wondering if you could possible provide a screenshot of the solution?

Thanks

19-Tanzanite
July 7, 2015

The solution is a hack job using scripted components to trap the error. Scripted components are not available in Prime though, so the solution does not apply. There is no way to trap an undefined variable error in Prime and handle it gracefully. Why do you need to do this though? The original poster wanted this because they were calling worksheets from other software via the automation interface. In MC14 (and MC15) there is then a very good reason why you would want to check whether or not a variable is defined, but in Prime it is not necessary to do so.