[comp.lang.forth] Cursor tracking

Mitch.Bradley@ENG.SUN.COM (05/17/91)

> Being able to save and restore the cursor position enables the coding of
> modular subroutines, for example, one that updates a time-of-day display,
> or a generic routine that displays "Press <Enter> to continue".

> Code to track the cursor position I consider to be a routine implementation
> task, and a fairly easy one as drivers go.

Cursor tracking is certainly conceptually straightforward, but I have found
that it is quite difficult to do "completely correctly".

You can track the column and line in EMIT and CR and TYPE , but what do you
do at the edge of the screen?  How do you know whether long lines are wrapped
or truncated?  How does the program find out the dimensions of the screen?
What happens if the user EMITs a backspace or a tab or a cursor-control
escape sequence?

I admit that it can be worthwhile to consider solving these problems; I have
spent a considerable amount of effort solving a subset of them in my system.
However, the general problem must be recognized as can of worms.

I suspect that opening this particular can of worms in the context of
the current ANS Forth effort would delay the standard by about a year,
before everybody got in his two-cents worth and a consensus was reached.

I doubt that the value of the feature is worth the cost of the delay.

This might be good issue to address as an addendum to the standard, after
the basic stuff is already published.

Mitch.Bradley@Eng.Sun.COM