I.T. Discussion Community!
-Collapse +Expand
VB Classic
Search VB Classic Group:

Advanced
-Collapse +Expand VB Classic Store

Prestwood eMagazine

August Edition
Subscribe now! It's Free!
Enter your email:

   ► KB ►► ProgrammingVB Classic   Print This    All Groups  

Visual Basic Classic Most Read KB Posts

Page Contents


Most Read KB Articles Since 3/28/2008

Visual Basic Classic Group

  KB Article    

Mike Prestwood
1. VB Classic Logical Operators (and, or, not)

VB Classic logical operators:

and and, as in this and that
or or, as in this or that
Not Not, as in Not This

Posted to KB Topic: Language Basics
10 years ago, and updated 10 years ago
(5 Comments , last by Winchester14.R )

Code

Article
Nothing New Since Your Last Visit  
16008
Hits

Mike Prestwood
2. VB Classic Comments (' or REM)

Commenting Code
VB Classic, like all the VB-based languages, uses a single quote (') or the original class-style basic "REM" (most developers just use a quote). VB Classic does NOT have a multiple line comment.

Directives - #

Directives are sometimes called compiler or preprocessor directives. A # is used for directives within VB Classic code. VB Classic offers only an #If..then/#ElseIf/#Else directive.

Posted to KB Topic: Tool Basics
11 years ago, and updated 10 years ago
(6 Comments , last by aadil.k )

Code

KB Post
Nothing New Since Your Last Visit
12823
Hits

Mike Prestwood
3. VB Classic Custom Routines (Sub, Function)

VB Classic is a non-OOP language with some OOP features. It offers both Subs and Functions. A Sub does not return a value while a Function does. When Subs and Functions are used in a class module, they become the methods of the class.

Posted to KB Topic: Language Details
11 years ago, and updated 10 years ago

Code

KB Post
Nothing New Since Your Last Visit
11501
Hits

Mike Prestwood
4. VB Classic Constructors (Class_Initialize)

When an object instance is created from a class, VB6 calls a special parameter-less sub named Class_Initialize. Since you cannot specify parameters for this sub, you also cannot overload it.

When a class is destroyed, VB6 calls a special sub called Class_Terminate.

Posted to KB Topic: OOP
10 years ago

Code
Nothing New Since Your Last Visit  
11377
Hits

Mike Prestwood
5. VB Classic Interfaces

VB6 has limited support for interfaces. You can create an interface of abstract methods and properties and then implement them in one or more descendant classes. It's a single level implementation though (you cannot inherit beyond that). The parent interface class is a pure abstract class (all methods and properites are abstract, you cannot implement any of them in the parent class).

In the single level descendant class, you have to implement all methods and properties and you cannot add any. Your first line of code is Implements InterfaceName.

Posted to KB Topic: OOP
11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
10137
Hits

Mike Prestwood
6. VB Classic Array (x = Array())

Arrays in VB Classic use a 0-based indice. UBound returns -1 if the array has no elements, 0 if it has 1, 1 if it has 2, etc.

Posted to KB Topic: VB Classic
9 years ago

Code
Nothing New Since Your Last Visit  
9797
Hits

Mike Prestwood
7. VB Classic Variables (Dim x As Integer)

VB Classic is a loosely typed language. Declaring variables is optional unless you use the Option Explicit statement to force explicit declaration of all variables with Dim, Private, Public, or ReDim. Using Option Explicit is strongly recommended to avoid incorrectly typing an existing variable and to avoid any confusion about variable scope.

Undeclared variables are variants. To specifically declare a variant, use:

Dim x As Variant
Dim x 

Common data types include Byte (0..255), Boolean, Integer (2-byte integers), Long (4-byte integers), Currency, Single (32-bit number), Double (64-bit number), Date, String, and variant.

Variables declared with Dim at the module level are available to all procedures within the module. At the procedure level, variables are available only within the procedure.

Posted to KB Topic: Tool Basics
11 years ago, and updated 10 years ago

Code

KB Post
Nothing New Since Your Last Visit
9758
Hits

Mike Prestwood
8. VB Classic Destructor

When an object instance is destroyed, VB6 calls a special parameter-less sub named Class_Terminate. For example, when the variable falls out of scope. Since you cannot specify parameters for this sub, you also cannot overload it.

When an object instance is created from a class, VB6 calls a special sub called Class_Initialize.

Posted to KB Topic: OOP
10 years ago

Code
Nothing New Since Your Last Visit  
9497
Hits

Mike Prestwood
9. Mimic Short-Circuit Evalution in VB

Short-circuit evaluation is a feature of most languages where once an evaluation evaluates to False, the compiler evaluates the whole expression to False, exits and moves on to the next code execution line. In VB Classic, the if statement does not support short-circuit evaluation but you can mimic it. Use either an if..else if..else if statement or nested if statements. You will find that your code that makes use of this technique will be clearer and easier to maintain than the short-circuit equivalent and faster than ingnoring the issue.

Posted to KB Topic: Tool Basics
11 years ago

Tip
Nothing New Since Your Last Visit
9395
Hits

Mike Prestwood
10. VB Classic Empty String Check (Len(s&vbNullString))

In VB Classic, you have to add an empty string to the value being compared in order to get consistent results. For example, add &"" to your string varilable or it's code equivalent &vbNullString. Then compare to an empty string or verify it's length to 0 with Len.

Posted to KB Topic: VB Classic
10 years ago

Code
Nothing New Since Your Last Visit
9195
Hits



Most Read by Members

Visual Basic Classic Group

  KB Article    

Mike Prestwood
1. VB Classic Comments (' or REM)

Commenting Code
VB Classic, like all the VB-based languages, uses a single quote (') or the original class-style basic "REM" (most developers just use a quote). VB Classic does NOT have a multiple line comment.

Directives - #

Directives are sometimes called compiler or preprocessor directives. A # is used for directives within VB Classic code. VB Classic offers only an #If..then/#ElseIf/#Else directive.

Posted to KB Topic: Tool Basics
11 years ago, and updated 10 years ago
(6 Comments , last by aadil.k )

Code

KB Post
Nothing New Since Your Last Visit
12823
Hits

Mike Prestwood
2. VB Classic Logical Operators (and, or, not)

VB Classic logical operators:

and and, as in this and that
or or, as in this or that
Not Not, as in Not This

Posted to KB Topic: Language Basics
10 years ago, and updated 10 years ago
(5 Comments , last by Winchester14.R )

Code

Article
Nothing New Since Your Last Visit  
16008
Hits

Mike Prestwood
3. VB Classic Code Blocks (End Xxx)

VB Classiccode blocks are surrounded by statement ending keywords that all use End such as End Sub, End If, and WEnd.

Posted to KB Topic: Tool Basics
11 years ago, and updated 10 years ago
(1 Comments , last by Adkins.V )

Code
Nothing New Since Your Last Visit
7806
Hits

Mike Prestwood
4. Visual Basic User Group Meeting Mike and Brian Prestwood presenting on the Unified Modeling Language.
Posted to KB Topic: VB Classic
13 years ago, and updated 11 years ago

News
Nothing New Since Your Last Visit
3964
Hits

Mike Prestwood
5. VB Classic Report Tools Overview

Crystal Reports was very popular with VB Classic developers and came bundled with Visual Basic 3 through 6. VB6 offers both Crystal Reports and the new Microsoft Data Report Designer.

Posted to KB Topic: Tool Basics
11 years ago, and updated 11 years ago

Code
Nothing New Since Your Last Visit
8097
Hits

Mike Prestwood
6. VB Classic Array (x = Array())

Arrays in VB Classic use a 0-based indice. UBound returns -1 if the array has no elements, 0 if it has 1, 1 if it has 2, etc.

Posted to KB Topic: VB Classic
9 years ago

Code
Nothing New Since Your Last Visit  
9797
Hits

Mike Prestwood
7. VB Classic Destructor

When an object instance is destroyed, VB6 calls a special parameter-less sub named Class_Terminate. For example, when the variable falls out of scope. Since you cannot specify parameters for this sub, you also cannot overload it.

When an object instance is created from a class, VB6 calls a special sub called Class_Initialize.

Posted to KB Topic: OOP
10 years ago

Code
Nothing New Since Your Last Visit  
9497
Hits

Mike Prestwood
8. Mimic Short-Circuit Evalution in VB

Short-circuit evaluation is a feature of most languages where once an evaluation evaluates to False, the compiler evaluates the whole expression to False, exits and moves on to the next code execution line. In VB Classic, the if statement does not support short-circuit evaluation but you can mimic it. Use either an if..else if..else if statement or nested if statements. You will find that your code that makes use of this technique will be clearer and easier to maintain than the short-circuit equivalent and faster than ingnoring the issue.

Posted to KB Topic: Tool Basics
11 years ago

Tip
Nothing New Since Your Last Visit
9395
Hits

Mike Prestwood
9. VB Classic End of Statement (Return)

Languages Focus: End of Statement

In coding languages, common End of statement specifiers include a semicolon and return (others exist too). Also of concern when studying a language is can you put two statements on a single code line and can you break a single statement into two or more code lines.

VB Classic End of Statement

A return marks the end of a statement and you cannot combine statements on a single line of code. You can break a single statement into two or more code lines by using a space and underscore " _".

Posted to KB Topic: Tool Basics
11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
6348
Hits

Mike Prestwood
10. VB Classic Comparison Operators (=, <>)

Save as VB Classic. Common comparison operators:

= equal
<> not equal
< less than
> greater than
<= less than or equal
>= greater than or equal
Posted to KB Topic: Tool Basics
11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
8762
Hits
Icon Legend:
Recent or not:
- Recent activity (within last two weeks).
- No activity last two weeks.
 Since your last logged visit:
- New to you or updated since your last visit (sign in now to activate).
- NOT new to you since your last visit (sign in now to activate).
Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech