Skip to main content
14-Alexandrite
September 28, 2022
Solved

Programme Progress

  • September 28, 2022
  • 1 reply
  • 3103 views

Has anyone got a technique for monitoring the progress of a programme?

 

If you are running a long iterative programme involving many loops (OK Prime is not the best for this I know), but still, it would be great if it were possible to trigger any kind of output to indicate progress.

 

Thanks!

 

 

Best answer by Werner_E

In Mathcad you could use the debug mode but thats not available in Prime.

So I guess all you could do is to write info data to a file from time to time (every 10000 iterations or the like) and inspect that file outside of Prime.

Of course output to a file slows down execution significantly so you should use it sparely.

 

 

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
September 28, 2022

In Mathcad you could use the debug mode but thats not available in Prime.

So I guess all you could do is to write info data to a file from time to time (every 10000 iterations or the like) and inspect that file outside of Prime.

Of course output to a file slows down execution significantly so you should use it sparely.

 

 

GeoffD14-AlexandriteAuthor
14-Alexandrite
September 28, 2022

Alas, I cannot find a way of writing to an external file from within a programme - e.g. trying to use the WRITECSV function to write to an external ,CSV creates an error that stops the programme.

25-Diamond I
September 28, 2022

Without seeing what you did its not possible to track down the cause of the error you encounter.

Here is a demo program which creates a csv file from time to time.

Werner_E_0-1664396986549.png

 

Drawback is, that each call of WRITECSV overwrites the previous files.

If this is not desired, you may read in the csv file, add the current data and write all data again in the file. Of course the file reading would once again need some time and slows down execution a little bit.

Werner_E_1-1664397028612.png

Other options are

  • Use WRITEPRN for writing header data and then APPENDPRN. The format of the file may be not what you desire, though.
  • Add a counter, create a new filename everytime and create multiple files
  • Use WRITEEXCEL because here you can save the data to a cell position of your choice and so you can use a counter to advance the row everytime you writ to the file. But when you open the file in Excel while your Prime program is still working, Prime will fail and throw an error.