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

ERNV bug: Mostly Harmless



Just discovered this in Xy4DOS:
If you have BX ernv [filename]Q2 in an XPL routine *and* if you have a
directory on screen *and* if the highlight bar is in the text area as opposed
to the command line, *then* the highlighted line will disappear from the
directory display. This does *not* mean that the file that was highlighted
will be deleted. If you do a dir command immediately, you'll see that the
file is not gone. (If the highlight was over a subdirectory, that line will
have disappeared -- patently not deleted!)

Of course, if it's just BX ernv Q2 (without a filename argument), the
highlighted file *will* be deleted.

BTW, ernv means "ERrase, No Verify" and has been available since at least
XYIII.

It sometimes works better than "del/nv", but I don't remember where.

Here's what's going on: Deleting a file in Xy is a two-step process: (1)
delete the file and (2) if a directory is displayed and the focus was in the
directory list, and the file to be deleted was the one highlighted, update
the directory list so that the file entry is removed. When you do a blind
execute of a file delete with an explicitly named file, and the focus is on a
file listed in a directory, step (1) is executed on the file argument in the
blind command, and step (2) is executed on the file list. Nasty, alarming,
and ultimately mostly harmless bug.

The cure: put the BC or GH function call ahead of the BX ernv [filename] Q2
command. That moves the focus out of the file listing.

Tim Baehr
tbaehr@xxxxxxxx