#1 the use of W ?COL


the use of W ?COL is too stupied. For example:

W ?50,"B",?40,"A"
W *27,*91,*55,*109,?40," A ",*27,*91,*48,*109 doesn't
work like we expect.

To make it work, we must write something like:

W ?50,"B" W *27,*91,$Y,*59,1,*72 S $X=1 W ?40,"A"

I think ? should automatic:

put the cursor at $Y,1
set $X=1
move cursor COL to rigth
write the text

that would make our work much more easy.


  • Steven Estes
    Steven Estes

    Logged In: YES

    Hello Paulo, and thank you for your post. Unfortunately, we
    cannot change things like this to work as you suggest
    because their definitions and interactions are pretty much
    fully described in the ANSI M standard to which we adhere as
    much as possible. Here's a brief summary of why the behavior
    you see is working as it is supposed to:

    The M format control characters are exclamation (!) for
    new-line question-mark (?) for position to column (sometimes
    called "tabbing") and pound-sign (#) for form-feed. When
    n'>$X the standard indicates that ?n is ignored, hence
    "backwards tabbing" is not allowed.

    The standard defines the maintenance of $X and $Y for the
    format control characters, and that all other characters
    increment $X by one (1). This means that output of
    non-graphic characters by means of $CHAR() or WRITE *, will
    generally cause $X and $Y to lose synchronization with the
    actual device. This can be overcome by using SET $X (and
    $Y), or by enabling the GT.M FILTER device parameter [for
    terminal output] with an appropriate argument. Note that
    FILTER requires parsing every character of output (which has
    performance implications), and assumes a particular [ANSI]
    interpretation of control characters and control sequences
    [which may not match every device].

    For example if you want to write something in column forty
    (say B) and something else in column 50 (say A) of the same
    line, then the straightforward thing to do is to order the

    Write !,?40,B,?50,A

    If you can't find a way to order things properly, some other
    possibilities are:

    Write !,?50,A,$C(13) Set $X=1 Write ?40,B

    If this is preceded by a USE $PRINCIPAL:FILTER="CHARACTERS"
    the SET command is unnecessary.

    Note also that the WIDTH and WRAP device parameters are
    factors to consider in screen formatting.