FW: Carriage Return oddity in Mathematica (follow-up)
- To: mathgroup at smc.vnet.net
- Subject: [mg31275] FW: Carriage Return oddity in Mathematica (follow-up)
- From: "Eric Stiers" <ewstiers at chorus.net>
- Date: Fri, 26 Oct 2001 04:28:17 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
While I have been unable to figure out how to resolve the LF/CR issue from
my earlier email, I have been able to develop a workaround which
accomplishes the same task (to keep a real-time indication of the row and
column number of the matrix element being calculated so as to be able to
estimate when the multi-day calculation will be completed.)
A lot of the credit for this method goes to Bob Hanlon who originally
suggested a procedure similar to the one shown below. I just modified it a
little bit.
nb = SelectedNotebook[];
Foo=Table[Part[{F[nx,nz],SelectionMove[nb, All, GeneratedCell];
NotebookDelete[nb]; Print["Location [" <> ToString[nx] <> ", " <>
ToString[nz] <> "] completed."]},1], {nx, 0, 100}, {nz, 0, 100}];
Sample output would look something like this:
Location [23, 45] completed.
and would update every time a new element calculation was started.
The basic idea is that the cell identifies all of its' outputs (with
SelectionMove[nb, All, GeneratedCell]) and deletes them (with
NotebookDelete[nb]), then generates a new output string with the index of
the element of the table that was just completed (the Print[] funtion). In
the next iteration, this string is the only output of the cell, and thus is
deleted just before the creation of a new and updated string.
Depending on your application, the designation of the variable nb may or may
not work for you - i.e. if you are using a different notebook as the 'front
end' to the one in which the table Foo is being calculated.
Take care,
Eric