Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Guidelines for Entering and Editing Code
◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Guidelines for Entering and Editing Code
■ You enter and edit code in the programming environment. The programming
environment has automatic formatting and syntax-checking capabilities
built in.
■ If the syntax checker is turned on, Visual Basic displays a message
whenever it encounters a syntax error. To toggle syntax checking in the
programming environment, choose Syntax Checking from the Options menu.
■ Use the following tips while working in the programming environment:
• To enter code, click in the programming environment and start typing
• To correct mistakes as you type, press Backspace
• To delete text, select it and press Del
• To move the cursor location, use the arrow keys
You can also click where you want the cursor location to be.
• To indent text, position the cursor and press tab
To remove an indent, press Shift+Tab.
• To switch between insert mode and overtype mode, press Ins
• To enter a comment in your code, start the line with an apostrophe (')
• To complete a Visual Basic statement, press Enter
• To write multiple statements on one line, use a colon (:)
For example, FOR i% = 1 TO 10: PRINT i%: NEXT i%
• To view two procedures at a time, create a new code window
Choose New Window, then choose Arrange All from the Window menu to tile
all open windows.
• To get Help on Visual Basic syntax from the programming environment
Type or select the keyword, function, statement, property, event, or
method, and press F1.
■ Follow these tips when working with declarations and variables:
• To enter an assignment statement, use this syntax:
destination = source
• To name a variable, begin the name with a letter, and use no more than
40 letters and numbers. Do not use reserved words.
• To use a data type to declare a variable, append the type-declaration
character to the end of the variable name: % (integer), & (long
integer), ! (single precision), $ (string), @ (currency).
See: ◄Basic Data Types Summary►