Tip Bank

DevX - Software Development Resource

Use the Immediate If Function in VBScript

Visual Basic includes the Immediate If function (IIf), but VBScript (VBS) does not. However, you can copy this code to VBS to allow the IIf function to be used: ‘VB

DevX - Software Development Resource

Algorithms: A Linear Search

This is a very straightforward loop comparing every element in the array with the key. As soon as an equal value is found, it returns. If the loop finishes without

DevX - Software Development Resource

GetGreyScale – Convert a color to greyscale

‘ Convert a color to greyscale’ Example: Me.BackColor = GetGreyScale(Color.Red)Function GetGreyScale(ByVal col As Color) As Color Dim greyValue As Integer = CType(col.R * 0.3 + col.G * 0.59 + col.B