Statements and Functions

Statements and functions are listed alphabetically. Each statement or function name appears as a bold heading in the margin. One or more syntax statements follow the bold heading. Here is a syntax example:

CharLeft [Count] [Select]

When you type an instruction, you must include all the items in the syntax that
are formatted in bold. Items enclosed in brackets are optional. Do not type the brackets when including an optional item. Italic formatting indicates argument names or value placeholders that you replace with actual values or variables to which you've already assigned values.

For example, you could use any of the following CharLeft instructions in a macro:


CharLeft
CharLeft 1
CharLeft 1, 1

If you assigned acceptable values to the numeric variables move and extend, you could use the following CharLeft instruction:


CharLeft move, extend

Note that you must separate arguments with commas. The acceptable values for arguments are listed in the remarks following the syntax, usually in a table. Some syntax examples include required arguments. For example:

EditReplaceStyle .Style = text

To use this statement, you must include the .Style argument — note the period preceding the argument name. You must type all the text that appears in bold and supply a specific value or variable for the italic placeholder, as in the following examples:


EditReplaceStyle .Style = "Heading 1"
EditReplaceStyle .Style = "Normal"

Other statements and functions include a mixture of required and optional arguments:

EditAutoText .Name = text [, .Context = number] [, .InsertAs = number] [, .Insert] [, .Add] [, .Delete]

According to this syntax, you must include the first argument and a value, but the remaining arguments are optional. As the syntax indicates, every argument in your final macro instruction must be separated by a comma. For example:


EditAutoText .Name = "disclaimer", .Context = 1, .Add

For more information about WordBasic syntax, see Part 1, "Learning WordBasic," which includes many examples of the correct use of WordBasic statements and functions. WordBasic Help and most entries in this reference also include examples of how to use specific statements and functions. For more information about typographic conventions used in this book, see "About This Book" in the front matter.