Visual Basic documentation uses the following typographic and code 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, lowercase letters indicate placeholders for information you supply. |
pathname, filenumber | Bold, italic, and lowercase letters indicate placeholders for arguments where you can use either positional (based on the procedure's pre-defined order) or named-argument syntax. |
[expressionlist] | In syntax, items inside brackets are optional. |
{While | Until} | In syntax, braces and a vertical bar indicate a mandatory choice between two or more items. You must choose one of the items unless all of the items are also enclosed in brackets. For example:
[{This | OrThat}] |
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. |
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 and an underscore ( _) continue a line of code. |