@Karen Payne MVP
Excuse me that I cannot show you the complete source code, because my project is too complex (117 MB), I can only explain to you the logical structure of the relevant part in words.
In the original version (EXE) with certain loop-parameters the visible updating of screen output stopped at 88% of loop progress, although the loop-execution was continued up to 100%.
In the test version (Debugger) I only added an try/catch-instruction around the loop and started execution with the same loop-parameters. Now all screen output was visible up to 100% of loop-progress. I wonder about this difference in behaviour between original and test version.
//New structure (simplified):
int counter = 0;
try
{
//Set loop-parameters, int limit = number
while (counter < limit)
{
//Do 1 new step of complex math work
counter++;
//Determine progress ratio counter/limit in percent --> out string mytext
//Display mytext
}
}
catch
{
//MessageBox: "Loop stopped because of exception at counter = " + Convert.ToString(counter);
}
With this try/catch-block (scheme) no exception and no memory issue were found.
The normal execution time of the loop may be approx. 7 hours.
How can you explain this to me?