Reputation: 944
I'm new to Maple, so excuse the question if it's obvious. I'm running some routines that take a long time, and I want to get updates as is goes. Basically I have a big for
loop and I want to see the output after each pass rather than having to wait for the end. Here's the idea of what I have:
for i from 1 to 10 do
M := complicatedFunction(i);
print(i, M);
od;
What this does is it runs through all 10 cycles, then prints all 10 outputs.
What I want is for the outputs to be printed at the end of each cycle, so I can see how well it's progressing. Is there a way to do this?
Upvotes: 1
Views: 2175
Reputation: 7246
It sounds as if you are using a Document, with your code being executed within a Document Block.
You could put your code inside an Execution Group instead (in which lines of code get input to the right of a red >
prompt). You can use the main menubar's Insert->Execution Group to insert such into a Document. The printing to an Execution Group should get done asynchronously (which is what you appear to want).
If your code is in a procedure then you just need the call to that procedure to be executed from an Execution Group, even if the procedure itself is defined elsewhere in some Document Block.
Alternatively you could switch over from a Document to a Worksheet for this coding. You can use the main menubar's File->Open to choose between Document and Worksheet. In a worksheet, the principal area for coding is a Execution Group. You can even set your preference for which is opened by default, under the menubar's Tools->Options-Interface.
Upvotes: 2