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

Bug alert: DEL/NV in programs



When you have a directory on-screen and you run a macro or an XPL
program, be careful. If your code includes, for instance, a
delete or copy or call command, and the highlight is in the file
list, your program may try to operate on the highlighted file --
even if you have an argument for the command.  For instance, BX
del filenameQ2 will delete filename under most circumstances.
But if there is a directory displayed, and if the cursor is in
the highlight (and not on the command line), the DEL command
will operate on the highlighted file! So always put a GH (go to
header) function call before commands like DEL, CALL, etc., if
you expect that a directory might be on-screen.

I have also discovered that if you have the command BX del/nv
filenameQ2 in an XPL program, and if there is a directory
on-screen, you'll have problems even if you precede the command
with GH. For some reason, when the command has finished
running, XyWrite will attempt to execute the command line. If
you have a command on the command line, you may get something
(or lose something!) you didn't expect. SOLUTION: Instead of
DEL/NV, use the old pre-Xy4 command ERNV (erase, no verify).
That seems to be safe. So, your code would look like GH BX ernv
filenameQ2.

Tim Baehr
Return address TBaehr@xxxxxxxx