
 MH> Thanks, MARK RUYS and HUGO LANDSMAN. I had to add the UNALIAS because
 MH> my alias for SET was getting in the way.

You could insert a * before SET to prevent the alias expansion.

 MH> I'm a little leery of the magic number 7, however, since the

Right, Mark too.  And I wouldn't like it my batchfiles as well.  So, change
this:

 MH> setdos|(set %@line[con,7]^set %@line[con,0])

to:
     setdos|(set %@line[con,%_co_magic]^set %@line[con,0])

Now, where does _CO_MAGIC come from?  You set it in your AUTOEXEC.BAT with the
lines:

    call co_magic
    set _co_magic=%?

Of course, you'll need the CO_MAGIC.BTM too:

    setlocal
    set file=%@unique[%temp]
    setdos>!%file
    setdos/e%@char[1]
    set n=0
    :Loop
    set l=%@line[%file,%n]
    if %l==**EOF** goto End
    iff %@index[%l,CURSOR OVERSTRIKE]==0 then^set return=%n
    elseiff %@index[%l,ESCAPE]==0 then^set %l^setdos/e%escape
    endiff
    set n=%@eval[%n+1]
    goto Loop
    :End
    del/q %file
    quit %return

The escape character would generate a syntax error when read unchanged, so I had
to kludge around it a bit.  But it gets restored to the original value (not
%@char[1]) too.

