[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: programming question



** Reply to message from Harry Binswanger  on Sat, 15 Feb 2003
23:56:56 -0500


> I guess there's, strangely, no VA to grab [value of VAriable NewWindow NW] from.

Did you consult TABLE VARIABLES? It's the most complete available
list of all VAriables. Not perfect -- but far more complete than anything else
in existence, contains a "live" example of actual usage (toggle into eXPanded
mode to see it), and is constantly being updated and refined (presently adding
new NBWin VAs). In that Table, you learn that...

 holds the current value. But you rarely need to work with it directly,
because it is simpler (and has other advantages) to always assume that NW=0,
i.e. that windows don't open or close automatically. In other words, to use a
procedure that works no matter what the value of NW is. In the example you
were working with, you really only have one question: you've closed the file,
and either the window is still open, or it isn't still open. Easier to deal
with that narrow question than to ask, well, if VA$NW=0 do this, if VA$NW=1 do
that, etc etc

The main "other advantage" is that window numbers when you launch the PM remain
the same when you terminate the PM. If you relied solely on NW=3, you might
close a file and window, then reopen file in a new window -- bearing a
completely different window number. That could screw up something, e.g. a
preexisting AdjacentScreen (func AS) relationship that some other program
relies upon.

The principle is, try not to disturb any existing window numbers. NBWin throws
this into a cocked hat, introducing something completely inexplicable: dynamic
window numbering. By default, when a low window number closes in NBWin,
existing higher-numbered open windows can be renumbered *while they're open*,
and be reassigned the lower number that has just become available. In other
words, the number of a window can change while it is alive! This is incredibly
stupid. Luckily, you can override it using a new NB VARiable WN
WindowNumbering, setting it to 1 (default=0): this preserves fixed window
number behavior. In other words, window #6 stays window #6 as long as it is
open; it doesn't unexpectedly and automagically become window #2, just because
window #2 became available for some unrelated reason.

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------