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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Can I check the value of a variable before it is calculated?

PekkaMarjamäki
1-Newbie

Can I check the value of a variable before it is calculated?

I would like to see the result of my many pages long mathcad calculation on the first page. Is this possible?

In other words, if I change the value of a variable in the first row, and that affects the equations on the last row, I have to scroll to the end of the file to see the effect. Or do I?

For a number of reasons, using Areas to hide a block of rows is not a good solution in this case.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Use the "trace" function and open the "debug" window.

View solution in original post

7 REPLIES 7

Are you talking about collecting results and displaying them above where calculated? If so, the answer is yes.

But you will have to use a Scripted component for this.

Mike

As Mike suggested, Richard Jackson has discussed this in a thread a while ago, but I would suggest another route.

Options?

Instead of scrolling have you tried using the home and end keys on your computer (may need ctrl+home ctrl+end).

Otherwise I suggest a different approach for long problems:

After you have a working sheet, go back and recast as functions, takes a little time, but is not difficult, basically adding argument lists containing the variables that you want to change. (if you want, could use same argument list for every function, even it only uses a few of the variables.)

Then put these functions into a separate file that you reference in. Then you could probable fit what you want to see on one sheet, calculate, and use, multiple results, or what ever.

As Mike says, this is possible using a scripted component. See here: Extra Components.mcd

Thanks.

The block with the Recalculate-button shows the way.

Strange that we need to use Visual Basic for this.

ps. To make it work when the value I want to check is few pages after the variable I edit, after editing the variable I had to first disable the evaluation of the script, then run a full recalculation (ctrl+F9), and then enable the script again. Otherwise the script didn't find the variable whose value it was printing in the text box.

Another option is to Hyperlink between the calculation stages of the document.

Right click on a math or text region then select properties and the "Tag" entry gives the Hyperlink name (add a #)

Andy

Use the "trace" function and open the "debug" window.

Great! This works. And for printouts I use the scripted component.

ps. outside loops or functions the value of trace-function should be printed or assigned to make it work:

trace(x) - doesn't work

trace(x)= - works

a:=trace(x) - works

Top Tags