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

Advanced
-Collapse +Expand VB Classic Store

Prestwood eMagazine

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

   ► KB ►► ProgrammingVB Classic   Print This    All Groups  

Visual Basic Classic New and Updated KB Posts

Page Contents


Recently Created

(Visual Basic Classic Group)

  KB Article    

Mike Prestwood
1. 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  
9762
Hits

Mike Prestwood
2. 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
9153
Hits

Mike Prestwood
3. VB Classic Self Keyword (Me)

The Me keyword is a built-in variable that refers to the class where the code is executing. For example, you can pass Me from one module to another.

Posted to KB Topic: Language Details
10 years ago

Code
Nothing New Since Your Last Visit
7890
Hits

Mike Prestwood
4. VB Classic Deployment Overview

VB applications require the VB runtime DLL (for version 6, it's VB600.DLL) plus any additional dependencies you've added such as Crystal Reports, ActiveX controls, and DLLs.

You can use any of the many free and commercially available installation packages.

Posted to KB Topic: Tool Basics
10 years ago

Code
Nothing New Since Your Last Visit
6689
Hits

Mike Prestwood
5. 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  
15945
Hits

Mike Prestwood
6. 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  
9463
Hits

Mike Prestwood
7. 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  
11331
Hits

Mike Prestwood
8. VB Classic Member Visibility

In VB Classic, the keywords Private, Friend, Public, and Static are used to set access levels for declared elements.

Posted to KB Topic: OOP
10 years ago

Code
Nothing New Since Your Last Visit
7667
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
9379
Hits

Mike Prestwood
10. VB Classic Member Method (sub, function)

VB classic uses the keywords sub and function. A sub does not return a value and a function does. Many programmers like to use the optional call keyword when calling a sub to indicate the call is to a procedure.

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

Code
Nothing New Since Your Last Visit
7572
Hits




Recently Updated

(Visual Basic Classic Group)

  KB Article    

Mike Prestwood
1. 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  
9762
Hits

Mike Prestwood
2. 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
9153
Hits

Mike Prestwood
3. 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  
15945
Hits

Mike Prestwood
4. VB Classic Self Keyword (Me)

The Me keyword is a built-in variable that refers to the class where the code is executing. For example, you can pass Me from one module to another.

Posted to KB Topic: Language Details
10 years ago

Code
Nothing New Since Your Last Visit
7890
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
10111
Hits

Mike Prestwood
6. VB Classic Unary Operators

An operation with only one operand (a single input) such as + and -.

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

Code
Nothing New Since Your Last Visit
7292
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
9729
Hits

Mike Prestwood
8. VB Classic Deployment Overview

VB applications require the VB runtime DLL (for version 6, it's VB600.DLL) plus any additional dependencies you've added such as Crystal Reports, ActiveX controls, and DLLs.

You can use any of the many free and commercially available installation packages.

Posted to KB Topic: Tool Basics
10 years ago

Code
Nothing New Since Your Last Visit
6689
Hits

Mike Prestwood
9. VB Classic Associative Array (Collection)

In addition to Add and Item, collections also offer Count and Remove. Notice that Add uses the format of Value, Key (which is backwards from many other languages).

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

Code
Nothing New Since Your Last Visit
9065
Hits

Mike Prestwood
10. 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
11473
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