devxlogo

Tip Bank

Sort The Contents of an Array

Private Sub BubbleSort(varArray As Variant, bAscending As Boolean) ‘Option Base 0 is assumed Dim HoldEntry As Integer Dim SwapOccurred As Boolean Dim iItteration As Integer Dim i As Integer SwapOccurred

Null Handling in VB6

A simple way to get around having to handle Nulls in fields from recordset is to concatenate a zero length string at the end of the field value, as illustrated

Validate Text to Numeric

Public Function ValidateTextToNumeric(ctlToValidate As TextBox)’**********************************’This function tests the validation’for Numeric value of a given text’**********************************Dim strTextToValidate As StringDim blnNumericValid As BooleanstrTextToValidate = ctlToValidate.Text’*** Validation would be TRUE, in all the

Populating Controls From a Recordset

On a form, basing populating controls on a supplied record may lead to error, because a perfect match is needed between the control tags and the field list. Any pre-specified

Making Global Objects

Let’s take an example: a program has a PrintSpooler class. This class maintains a queue for printer requests and serializes them. The program cannot contain multiple PrintSpooler Objects because this

Avoiding Dependencies #2

Many C++ programmers will be familiar with the tidal wave of recompilations that occur when a seemingly unrelated header file is changed. C++ file dependencies need to be managed otherwise

Avoiding Dependencies #1

Many C++ programmers will be familiar with the tidal wave of recompilations that occur when a seemingly unrelated header file is changed. C++ file dependencies need to be managed otherwise