Visual Basic Language Reference  

Typographic and Code Conventions

Visual Basic documentation uses the following typographic and code conventions.

Typographic Conventions

Convention Description
Sub, If, ChDir, Print, True, Debug Words in bold with initial letter capitalized indicate language-specific keywords.
Setup Words you are instructed to type appear in bold.
object, varname, arglist Italic letters indicate placeholders for information you supply.
[ expressionlist ] In syntax, items inside brackets are optional.
{ Public | Private } In syntax, braces and a vertical bar indicate a mandatory choice between two or more items. You must choose one, and only one, of the items.
[ Protected | Friend ] In syntax, a vertical bar separates alternative options. Within brackets, the alternatives are not exclusive. Within braces, the alternatives are exclusive.
[{ ByRef | ByVal }] In syntax, brackets surrounding items within braces indicate that no more than one item may be included, and the items may also be omitted entirely.
membname1. membname2, membname3 Subscripts differentiate multiple instances of the same placeholder.
membname1

...

membnamen

In syntax, ellipses indicate an indefinite number of items of the kind immediately preceding the ellipses.

In code, ellipses signify code omitted for the sake of clarity.

ESC, ENTER Words in capital letters indicate key names and key sequences.
ALT+F1, CTRL+R A plus sign (+) between key names indicates a combination of keys. For example, ALT+F1 means hold down the ALT key while pressing the F1 key.

Code Conventions

Sample code Description
MyString = "Hello, world!"
This font is used for code, variables, and error message text.
' This is a comment.
An apostrophe (') introduces code comments.
MyVar = "This is an " _
& "example" _
& " of how to continue code."
A space followed by an underscore ( _) at the end of line continues a line of code.

See Also

Visual Basic Language and Run-Time Reference