July 21, 2001

LinkedList – a class module to store list of values

‘————————————————-‘ LINKED LIST class module” This class implements a linked list structure, where you can store’ values (appending them after the last element or inserting them at’ given indexes), remove them, and visit them using recordset-like’ methods such as MoveFirst, MoveNext, and Move(n)” NOTE: make Item the default member for

CBitArray – a class for dealing with large arrays of Boolean

‘ ————————————————————————‘ The CBITARRAY class” simiulates an array of Boolean values’ saves memory by packing one element in one bit” IMPORTANT: you make make ITEM the default member for this class’ do this from inside the Tools | Procedure Attributes dialog box” Usage:’ Dim bitArr As New CBitArray’ bitArr.Init(10000) ‘

CQueue – a class module to implement First-In-First-Out (queue) structures

‘————————————————–” The CQUEUE class’ Dim qu As New CQueue” ‘ enqueue to items to the queue’ qu.Enqueue 1234′ qu.Enqueue 5678′ ‘ display number of elements in the queue’ Debug.Print “Count = ” & qu.Count’ ‘ peek at the element about to be read’ Debug.Print “Peek = ” & qu.Peek’ ‘

CStack – a class module for implementing Last-In-First-Out (stack) structures

‘————————————————–” The CSTACK class” Usage:’ Dim st As New CStack” ‘ push two values on the stack’ st.Push 1234′ st.Push 4567′ ‘ display number of elements in the stack’ Debug.Print “Count = ” & st.Count’ ‘ peek at the element on top of stack’ Debug.Print “Peek = ” & st.Peek’

HashTable – a class module for storing (key,value) pairs

‘———————————————-‘ HASHTABLE class module” This class implements a hashtable, a structure that offers many’ of the features of a collectior or dictionary, and is often’ even faster than the built-in collection.” NOTE: must make Item the default member, using the Tools | Procedure ‘ Attributes dialog” Usage:’ Dim ht As

Using Repeated-Letter Variable Names

When using a variable as a loop index, it is common to use single-letter variable names. This is a bad practice, because it can make it difficult to find all places where the index is used inside the loop. For example, if you try to search for the use of

Dynamically Creating Controls in Palm OS

Creating controls in Palm OS is very useful. It gives vital power to the programmer in creating applications. There are various controls in Palm OS like buttons, check boxes, radio buttons, lists, text boxes, lists, etc. Buttons, check boxes, and radio buttons can be created dynamically using the following API:

Use sp_executesql To Execute Dynamically Built SQL Statements in SQL Server

There are two ways in SQL Server to execute a T-SQL statement that has been dynamically built. The most common one is using EXECUTE to run it: EXECUTE @sqlstatement In most situations, a better alternative is to use the system stored procedure sp_executesql. This has two major advantages over EXECUTE.

Select a Specified Interval of Rows in SQL Server

Selecting the top N rows in a table is no problem in SQL Server, but how to select the 2N to 3N rows is not as clear. Using the following SQL statement, you can achieve this functionality (retrieve the 21-40th highest orders): SELECT TOP 20 OrderID, SubtotalFROM Northwind.dbo.[Order Subtotals]WHERE NOT

No more posts to show