cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

check if variable is defined

SOLVED
Highlighted
Newbie

check if variable is defined

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: check if variable is defined

7 REPLIES 7
Highlighted

Re: check if variable is defined

Re: check if variable is defined

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

Highlighted

Re: check if variable is defined

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.

Highlighted

Re: check if variable is defined

Hi Tyler,

Please find the contents of the Mathcad worksheet in attachment in PDF and XPS file formats and on screenshots below:

Pic_1.png

Pic_2.png

Pic_3.png

Highlighted

Re: check if variable is defined

You wrote originally "In order to automate my Mathcad 14 sheets I would like..." So why can't you open .mcd files?

Highlighted

Re: check if variable is defined

Luc,

The very first post in this thread belongs to Holger, not Tyler.

Highlighted

Re: check if variable is defined

You're right. Confusion on my part.

Announcements