IT SOLUTIONS
Your TECHNOLOGY partner! 
-Collapse +Expand
VB Classic
Search VB Classic Group:

Advanced
-Collapse +Expand VB Classic Store

Prestwood eMagazine

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

   ► KB ►► ProgrammingVB Classic   All Groups   Print This   

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 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
53 months ago

Code
Nothing New Since Your Last Visit  
5268
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
52 months ago, and updated 45 months ago

Code

Article
Nothing New Since Your Last Visit  
4563
Hits

Mike Prestwood
3. 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
53 months ago

Code
Nothing New Since Your Last Visit  
4204
Hits

Mike Prestwood
4. 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
55 months ago, and updated 53 months ago

Code

KB Post
Nothing New Since Your Last Visit
4062
Hits

Mike Prestwood
5. 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
39 months ago

Code
Nothing New Since Your Last Visit  
3963
Hits

Mike Prestwood
6. 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
55 months ago, and updated 53 months ago

Code
Nothing New Since Your Last Visit
3799
Hits

Mike Prestwood
7. 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
51 months ago

Code
Nothing New Since Your Last Visit
3563
Hits

Mike Prestwood
8. 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
55 months ago, and updated 52 months ago

Code

KB Post
Nothing New Since Your Last Visit
3388
Hits

Mike Prestwood
9. VB Classic Constants (Const kPI = 3.1459)

Scope can be Public, Global, or Private. The use of the newer Public keyword is preferred to the older Global. Private Const is the same as just specifying Const.

Posted to KB Topic: Tool Basics
54 months ago, and updated 53 months ago

Code
Nothing New Since Your Last Visit
3262
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
54 months ago, and updated 53 months ago

Code
Nothing New Since Your Last Visit
3214
Hits



Most Read by Members

Visual Basic Classic Group

  KB Article    

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

News
Nothing New Since Your Last Visit
2157
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
52 months ago, and updated 45 months ago

Code

Article
Nothing New Since Your Last Visit  
4563
Hits

Mike Prestwood
3. 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
55 months ago, and updated 54 months ago

Code
Nothing New Since Your Last Visit
2730
Hits

Mike Prestwood
4. 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
39 months ago

Code
Nothing New Since Your Last Visit  
3963
Hits

Mike Prestwood
5. 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
54 months ago

Tip
Nothing New Since Your Last Visit
2632
Hits

Mike Prestwood
6. 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
54 months ago, and updated 53 months ago

Code
Nothing New Since Your Last Visit
2502
Hits

Mike Prestwood
7. VB Classic Unary Operators

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

Posted to KB Topic: Tool Basics
55 months ago, and updated 52 months ago

Code
Nothing New Since Your Last Visit
2740
Hits

Mike Prestwood
8. VB Classic If Statement (If..ElseIf..Else..End If)

The End If is optional if you put your code on a single line.

Posted to KB Topic: Tool Basics
56 months ago, and updated 53 months ago

Code
Nothing New Since Your Last Visit
3016
Hits

Mike Prestwood
9. 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
45 months ago

Code
Nothing New Since Your Last Visit
2824
Hits

Mike Prestwood
10. 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
51 months ago

Code
Nothing New Since Your Last Visit
3563
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).
-
  Load Time=less than 1 second.
 
Print This
-
 
Have a question? Need our services? Contact us now.
--Mike Prestwood

Call: 916-726-5675

email: info@prestwood.com


817 People Online Now!!  
Online Now: Sign In to see who's online now!  Not a member? Join now. It's free!
Show More...


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