vEdit commands take two types of arguments - numeric and string. Arguments must be enclosed in (...) following the command name. When there are two or more arguments, they must be separated from each other with commas.

Each numeric argument can be a numeric expression consisting of numeric constants (e.g. 12345), numeric variables (e.g. #10), reserved words (e.g. ALL) or the return value from a command (e.g. File_Size).

Numeric arguments have the range of +/- 2,147,483,647. When a large number is needed, for example to specify an "infinite" repeat count, the reserved word "ALL" can be used; its value is greater than one billion.

For example, the command Print(n) prints 'n' lines of text. The command Print(1000000) could be used to print the entire file (up to 1 million lines anyway). However we recommend Print(ALL) - Print the entire file, starting at the current edit (cursor) position.

String Arguments

Each string argument can either be a string constant (e.g. "hello") a string variable stored in a text register (e.g. @20), or one of the predefined string values, (e.g. CUR_DIR).

A string constant is enclosed in "delimiters" that cannot occur in the string. The allowable delimiters are:

` ' "  % & * , .  :  ; / ~ ^ =

As a convention, we use double-quotes as the string delimiters whenever possible. When the string contains double-quotes, we use single-quotes or the forward-slash.

Ins_Text(/The name is "TOM"/)

Since the normal double-quote character is part of the string constant, "/" is used as the string delimiter.

String arguments are often accessed from text registers which can be used as string "variables". The syntax @r uses text register 'r' as the entire string argument. The register can contain any characters, even including the string delimiter.

Reg_Set(20, /The name is "TOM"/)
Ins_Text(@20)

Text register 20 is used as a string variable in the Ins_Text( ) command. It performs the same insertion as the previous example.

Although not available for all string arguments, all filename arguments plus the Search( ), Replace( ), Match( ) , Statline_Message( ) , System( ) and Goto commands can use a text register as a portion of the string argument. Thesyntax |@(r) uses text register 'r' as a portion of the string argument.

The following equivalent commands display a directory of all "chapter1.*" files in the current directory.

Directory("chapter1.*")
Reg_Set(10,"chapter1.*")
Directory(@10)
Reg_Set(10,"chapter1")
Directory("|@(10).*")

The predefined string values can be used anywhere that a string constant can be used.

Reg_Set(10,CUR_DIR)
Set text register 10 to the pathname of the current directory.

Appendix D gives a description of all predefined string values.

Learn about Multiple Line String Arguments.

Argument Command Options

Many commands have an optional argument referred to as "options". Technically it is a normal numeric argument, but we highly recommend that any options be specified using the appropriate reserved words. When two or more options are needed, the corresponding reserved words are ORed together with "|" or added together with "+". (Note: "|" is <Shift-\>.)

It is better to "OR" the options together with "|" in case you inadvertently specify the same option twice. For example, the

options "CASE | ... | CASE" works properly, while "CASE + ... + CASE" gives unpredictable results. However, we use "+" in this manual because it is more readable.

This command EVERSE+NOERR performs a search in the reverse direction and suppresses the error message if the string is not found.

Search("text", REVERSE+NOERR)

The command option COUNT is followed by an additional numeric argument, often indicating the number of times the command is to be repeated.

Search("text",COUNT,3)

The command option COLSET is followed by two additional numeric arguments that set the explicit columns for a columnar block operation.

Search_Block("text",Block_Begin,Block_End,COLSET,10,40)

When COUNT and COLSET are both used, the argument for COUNT comes first. Combining the two examples above gives:

Search_Block("text",BB,BE,COUNT+COLSET,3,10,40)
Although all reserved words are numeric constants, your macros should always use the reserved word because their specific value may change in future versions.

Other Resources