You can repeat a command in VISTA without typing it over by using the %
character. The % character comes before the command you want to repeat.
It is also possible to modify a command while you repeat it.
The % command comes in several forms:
- Typing '%' by itself repeats the last command that you executed.
- Typing 'of the command can be found by the HISTORY command.
- Typing '%string' repeats the last command beginning with 'string'.
As an example, suppose the HISTORY command gives the output:
10 RD 1 [MYDIR]HD183143
11 MN 1
12 ADD 2 1
13 PLOT 1 R=342 MIN=100.0 MAX=300.0
14 MASH 4 1 SP=100,103
15 PLOT 4
Then
- %
- repeats command 15 (the last command): PLOT 4
- %10
- repeats command 10: RD 1 [MYDIR]HD183143
- %MASH
- repeats command 14 (the last MASH command):
MASH 4 1 SP=100,103
- %M
- repeats command 14: MASH 4 1 SP=100,103
Note the last example: The history mechanism will repeat the last command
which begins with 'M'. If there are several commands which begin with the
same letter, you have to supply enough of the command name after the % to
uniquely specify the command to be repeated.
It is possible to modify a previous command using the % construction
before executing the command again. There are several ways in which this
modification can be done:
- You can ADD words to the command by typing them after you enter
'%command', provided that these words are not keyword values
(EXPRESSION=VALUE) which are already present in the previous
command.
- You can modify keyword values which already exist in the previous
command by simply repeating the keyword with a new value. For
instance, if the old command was "PLOT 1 R=200 XS=200 XE=300
MIN=400", and you re-ran the command with "%PLOT R=234", the new
command would be "PLOT 1 R=234 XS=200 XE=300 MIN=400"
- You can force a keyword value to be added to or deleted from the
previous command (and not substituted as described above) by
preceding the keyword with a plus (+) or minus (-) sign.
As an examples of command modification with %, assume you wanted to repeat
in various ways the command
which, we will assume is number 10 in the history list.
- %10 HARD
- does PLOT 1 R=50 HARD
- %10 R=55
- does PLOT R=55
- %10 R=55 HARD
- does PLOT R=55 HARD
- %10 XS=100 XE=200
- does PLOT 1 R=50 XS=100 XE=100
Now suppose that command number 58 was
- PLOT 3 PIXEL HARD XS=100 XE=300 MAX=4096.0
Then
- %58 -PIXEL -HARD
- does PLOT 3 XS=100 XE=300 MAX=4096.0
Note: When using the '-' sign to delete words, you must supply an exact
match to the word being deleted.