V - Void the last active line.

Syntax:

v

Description:

 

V voids (undoes) the effects of the last line to contain an active FRED command. For example, in

*d
v

V undoes the effect of the *D and restores the previous contents of the current buffer.

V voids an entire line of commands. For example, consider

s/a/b/ s/1/2/
v
s/a/b/
s/1/2/
v

The first V undoes both of the substitutions that precede it; the second V only voids the s/1/2/.

V only voids lines that contain active commands. An active command is one that changes the contents of a buffer, a number register, or a defined pattern, or else switches from one buffer to another. A passive command is one that only displays information (e.g. F), or that changes nothing more than "." or the questionable flag on the current buffer. The following commands are considered passive for the purposes of V.

! " # :
= @ \ F
G J L P
Q T U V
W Y Z ZC
ZP ZW

All other FRED commands are active. In addition, a W or F command that changes the file name associated with a buffer will also be active.

When you issue a V, FRED will skip all command lines which only contain passive commands and will void the effects of the most recent line containing at least one active command.

A few of the commands listed above deserve some comment on why they are passive. G and U are passive in themselves; however, if their command lists contain active commands, V will undo the entire Global or Until construct. Therefore V will not undo

g/%/p

but it will undo

g/%/ s/+/-/

Similarly, if a command line consists of

\B(buff)

V will undo the effects of the buffer if (buff) executes any active commands, but will ignore the line if (buff) executes purely passive commands.

There are times when V will affect the current buffer in such a way that the questionable flag on the buffer will not be correct. For example, consider

*d r /file
*s/%/#/
w
v

V undoes the effects of the most recent line containing an active command; in this case, the V will undo the *S. Before the *S, the questionable flag was off because of the read. Therefore, after the V the questionable flag will be off because FRED returns to the state it had before the *S. However, the write has already taken place and /file contains the contents of the buffer as they were modified by the *S. In other words, the buffer contains the original contents of /file, whereas /file contains the modified contents. The buffer and the file differ, yet the questionable flag is off.

You may occasionally be misled in situations such as this; however, in most cases, FRED's distinction between active and passive commands will see that the questionable flag is correct after a V.

After an error or a BREAK has occurred, you might have trouble figuring out if an active command has really been executed. For this reason, FRED lets you use V after any ? message. If no active command on the line was executed before the error occurred, the V command will be ignored. In other words, the V cleans up after the error or BREAK. If the error or BREAK did nothing, the V doesn't do anything either. Subsequent V commands will work normally.

If an error occurs on a line that also contained a V command, the location of the error determines what another V command will do. If the error occurrs before FRED gets to the V command, typing a new V will clean up after the error. If the error occurrs after FRED got to the V command, a new V will only undo things back to the V command; thus it does not undo the entire line.

FRED allows up to 10 levels of voiding. Thus by issuing a series of V commands, you can void the effects of the 10 most recent lines containing active commands. Remember that V will skip lines that consist only of passive commands. FRED issues an error if you try to use V beyond the number of levels that FRED has currently saved (e.g. 11 times in a row).

Since V itself is a passive command, V will not undo another V command. To undo a V command, use ZV.

V does not affect the current pattern //. Thus // will always be the one most recently used in a FRED command, even if that command has been undone with V.

Copyright © 1998, Thinkage Ltd.