How can I tell when a new column or page starts?


Question

How can I tell when a new column or page starts? I've tried to use the &$LC system symbol but it doesn't always seem consistent.

Answer

  To get the best results:

  o   be sure and convert the symbol value to device units (using the &DV'
      attribute) to avoid round-off error
  o   turn off widow zone processing
  o   avoid using keeps, floats, or named areas
  o   use single column mode, or turn off vertical justification
  o   cause a line break if possible before testing &DV'&$LC

  The &$LC system symbol that DCF provides returns the transient remaining
  depth of the current column. This value does not reflect:

  o   the depth of the previous line unless a line break has occured
  o   the depth of the current input line because symbol substitution is
      performed before the line is processed (formatted)
  o   the depth of any unplaced widow zone lines
  o   the depth of any unplaced keeps, floats, footnotes, areas, and tables

  The effect of placing these items, or changing the depth of the running
  heading or footing, or doing column balancing, vertical justification, etc
  can also change the remaining space on the page and will thus change the
  position of any given output line. None of these things can be considered
  in resolving the &$LC symbol because they will take place in the future;
  that is, they have not been done when the symbol is queried.

  In order to correctly return the current output location on the page (which
  is what is really wanted), DCF would have to "pretend" to end the page and
  do column balancing & vertical justification. It would also have to pretend
  to place any pending keeps, floats, etc.  This would give the current
  output location IF the page were ended at the time the symbol was queried.
  It would still not include the current line since symbol substitution is
  still done first.  Of course, you probably don't really want to end the
  page, so DCF would need to remember where it was and restore everything to
  its proper state after determining the symbol value.

  Given the problems with &$LC, what can you do? There are a few things that
  help:

  o   when querying the symbol value or storing it in a local symbol for
      later comparison, be sure and qualify the symbol value with &DV.  This
      will convert the symbol from line spaces in the current font to device
      units, and help avoid round-off error.
  o   turn off widow zone processing
  o   do not use keeps, floats, or named areas
  o   use single column mode, or turn off vertical justification

  Doing the above things will make the symbol more accurate, but of course
  they will change the formatting results to possibly less desirable output.

  This is documented in the Text Programmer's Guide in the discussion of
  SCRIPT system symbols. Although not in this much detail, it does state that
  &$LC is inaccurate because of the problems described above.

Last updated: 93/08/04 14:08:04

Previous Contents Next