Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fileoutput in programs? 2

Status
Not open for further replies.

ChrMeissner

Mechanical
Joined
Jan 31, 2005
Messages
21
Location
DE
Hi all,

I have a very big program/procedure in 'MathCad 2001 Pro' that takes more than one hour for calculation. Sometimes it never comes to an end.

How can I put an interim result to a file while the program is running? ('PRNSCHREIBEN' doesnt work in programs)

If that would be possible, I would be able to look in this file with an editor and know how far the calculation already is and why it doesn't converge.

Many thanks,
Christian (TU Chemnitz, Germany).
 
There is an undocumented 'feature' in MathCad which allows you to write data out to a file from a program. Looks something like

writeprn(myvariable, "myfilepath")

Where myvariable is the variable or matrix to be written out, "myfilepath" is a string containing the complete path to your file.

Now I have looked at it I am not sure whether myvariable and "Myfilepath" should be the other way round - experiment.
 
Many thanks for this helpful hint. I just wrote a litle C-Program for overseeing the status of a MathCad procedure. It's fantastic!

Here is a screenshot:
QuZjo7bp.gif


Bye,
Christian.
 
Good one, TheWordforToffee! I've always wanted a way of getting intermediate results for debugging purposes, and this does nicely.

The actual syntax is WRITEPRN(filename,A) or APPENDPRN(filename,A).



Bung
Life is non-linear...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top