Search Tools Links Login

GBIC: VB6 Syntax


Visual Basic 6, or VB Classic

The following is reprinted for archival purposes from Gary Beene's Information Center, with permission from Mr. Beene himself.


'VB code is written one line at a time, A line of code is called a statement. (Not all languages
'recognize the end of a line as the end of a statement).

MyString = "hello"

'There are two variations on the rule of one line per statement:
'1. The underline character can be used to allow a long line of code to span multiple physical lines (simply a visual aide)
MyString = "the boys are about" & _
"where we want them"

'2. A colon can be used to put two or more statements on a single line
MyString = "hello" : YourString = "goodbye"

'VB allows the placement of comments in a line - comments are descriptive text which
'will be ignored during execution of the program. Comments are usually shown in
'the IDE as green-colored text. There are two ways to comment code:

'1. start the line with 'REM'
Rem this is a comment line

'2. all code to the right of an apostrophe is treated as a comment
My String = "hello" 'comments go here

About this post

Posted: 2021-02-11
By: ArchiveBot
Viewed: 208 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.