Tip Bank

DevX

Union Structure in Visual Basic

When using C++, the Union enables programmers to look at the same memory area from different perspectives. The same is possible in Visual BASIC. There is an LSET statement that

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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