As you enter Command Mode commands,
you will be able to see their effect
in the upper left window.

Here are several commands for moving
the cursor:

EOF	    Move to end of file
BOF	    Move to begin of file

Line	    Move down one line
Line(10)    Move down 10 lines
Line(-5)    Move up five lines

Char	    Move right one character
Char(-1)    Move left one character
Char(-20)   Move left 20 characters

Type each of these commands. Remember
to press <Enter> after each command.

--- Press <Ctrl-A> to continue ---


Two commands delete text:

Del_Char     Delete current character
Del_Char(5)  Delete next 5 characters

Del_Line     Delete rest of current line
Del_Line(-2) Delete previous two lines

--- Press <Ctrl-A> to continue ---















Several commands insert text:

Ins_Text("text")   Insert the
		   following 'text'

Ins_Char(n)	   Insert character
		   with value 'n'

For example, give the command:

Ins_Text("Insert this text.")

To insert the graphics character with
value "205" give the command:

Ins_Char(205)

--- Press <Ctrl-A> to continue ---






The real power of Command Mode comes
from the ability to combine commands.

For example, the commands to insert a
new line at the end of the file are:

End_Of_File
Ins_Text("This is the last line")
Ins_Newline(1)


The commands to delete the first line in
the file are:

BOF Del_Line(1)

Note: "BOF" is the abbreviation for
"Begin_Of_File". Most commands have an
abbreviation. Commands can be entered
one per line or several per line.

--- Press <Ctrl-A> to continue ---


The "Search" command searches for
text. For example, to find the next
occurrence of "the" give the command:

Search("the")

The command to search for the 4th
occurrence of "the" is:

Search("the",COUNT,4)

(Try this: press <Cursor Up> to get the
previous command `Search("the")', press
cursor left, and type ",COUNT,4" and
press <Enter>.)

--- Press <Ctrl-A> to continue ---







The commands to search from the
beginning of the file for the word "the"
occurring at the beginning of a line is:

Search("|<the",BEGIN)


You can also use the Command Mode as a
simple integer calculator by just typing
in the algebraic expression you want
calculated. For examples, enter:

12 + (169 / 13)    (and <Enter>)

24 * 92 - 16

--- Press <Ctrl-A> to continue ---







You can also calculate the ASCII values
of characters and control characters.
For example, enter:

'A'

Its value is 65 because the letter 'A'
is the 65th character in the ASCII
table. For the value of <Ctrl-S> enter:

^S	(Type "^", then type "S".)

Its value is 19.
--- Press <Ctrl-A> to continue ---










VEDIT PLUS's on-line calculator also
works with hexadecimal numbers. For
example, to convert the hex number
"FA3B" to decimal, enter:

0xFA3B

Its value is 64059.

To convert decimal "1234567" to hex,
enter:

$1234567

Its value is 0x12D687.


--- Press <Ctrl-A> to continue ---






You can even perform mixed-radix
calculations like this:

(0xFA3B - 59) / 64

--- Press <Ctrl-A> to continue ---


















The following "macro" will display the
line numbers of those lines in our file
that contain the phrase "VEDIT".
Carefully type it as one long line. (It
will wrap onto multiple screen lines.)

BOF
Repeat(ALL) {
    Search("VEDIT")
    Num_Type(Cur_Line)
    Line()
}

Here is how it works:

The "BOF" goes to the beginning of the
file. The "Repeat(ALL)" specifies a
loop which is to be repeated. The
Search("VEDIT") searches for the phrase.
The Num_Type(Cur_Line) displays the
current line number. The macro loops
until the search fails.
--- Press <Ctrl-A> to continue ---

Congratulations. You have now written
a computer program using VEDIT PLUS!

--- Press <Ctrl-A> to continue ---




















Here is a macro that counts the number
of words in the file and displays the
result:

#101=Search("|S|A",NOERR+BEGIN+ALL)
Message("Word Count  =  ")
Num_Type(#101)

Try it.

The first command searches through the
entire file, from the beginning, and
returns the number of words found and
stores it in register #101.
The Message() command displays the
"Word Count = " message, and the
Num_Type() command displays the value
in register #101. (Number of words)

--- Press <Ctrl-A> to continue ---




VEDIT PLUS has many internal counters
which simplify writing useful macros.
You can display the value of any
internal value by using the on-line
calculator feature. Precede the
internal counter name with "." to
display in decimal or "$" to display
in hexadecimal.

For example, "File_Size" returns the
size of the current file, "Cur_Pos"
returns the current position (offset)
in the file, and "Cur_Line" returns
the current line number. Try entering
the following commands:

. File_Size

. Cur_Pos

. Cur_Line
--- Press <Ctrl-A> to continue ---


"Out_Ins()" is a very powerful command
which lets you re-route anything that is
normally displayed on the screen into
the file.

For example, try this variation of the
previous macro. Note that command
abbreviations are used. Many commonly
used commands have an abbreviation.

#101=S("|S|A",NOERR+BEGIN+ALL) EOF()
OI() M("Word Count  =  ") NT(#101)

Note: In this case the M() and NT()
commands must follow the OI() on the
same line.


--- Press <Ctrl-A> to continue ---





Note:	Since the help system fills
	the entire screen, you should
	read these instructions before
	typing anything.

The "H" command gives help in Command
mode by first displaying several
screens which list all commands. For
help on a particular command type the
command letter(s) and <Enter>.

For example, for help with the
"Config_Tab()" command which changes the
Tab positions, type "H" and <Enter> and
then "T" for Topic, followed by
"configtab" or its abbreviation "cft"
and <Enter>.

--- Press <Ctrl-A> to continue ---





As an alternative, you can give the
command H("CFT") (and <Enter>) which
skips the help menu and directly gives
help on the "Config_Tab" command.

The "H" command gives help on any
command.

The on-line help uses the file
VPHELP.HLP. You can easily change
this file to suit your own purposes.
It is also informative to print this
file; it contains approximately the
same information as the Quick Reference
section of the manual.

--- Press <Ctrl-A> to continue ---







This tutorial has barely scratched the
capabilities of the Command Mode.
However, we hope that it has given you a
few hints on how it can be used.

If you are the programming type, you may
want to view or print the on-line help
file VPHELP.HLP. The 2nd half of this
file gives a summary of the command mode
and briefly describes each command.

--- Press <Ctrl-A> to continue ---
