%: Repeating/Editing a Previous Command

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:

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
\begin{example}
\item[\%\hfill]{repeats command 15 (the last command): PLOT 4}
...
...00,103}
\item[\%M\hfill]{repeats command 14: MASH 4 1 SP=100,103}
\end{example}

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:

  1. 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.

  2. 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"

  3. 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
\begin{hanging}
\item{PLOT 1 R=50}
\end{hanging}
which, we will assume is number 10 in the history list.

Now suppose that command number 58 was

Then

Note: When using the '-' sign to delete words, you must supply an exact match to the word being deleted.