Memory Deallocation Myths
A common myth among programmers says that you can avoid calling delete in your application because the operating system will release the allocated memory when the application terminates anyways. Indeed,
A common myth among programmers says that you can avoid calling delete in your application because the operating system will release the allocated memory when the application terminates anyways. Indeed,
‘ convert a telephone string into a phone numberFunction PhoneNumberFromString(ByVal PhoneString As String) As String Dim i As Integer Dim acode As Integer Const PhoneDigits = “22233344455566677778889999” ‘ prepare result
‘ search for a string starting at a given index’ and return the index of the character that follows’ the searched string (case insensitive search)Function InstrAfter(Source As String, Search As
Here’s a short code snippet that lets you programmatically open and close the CD door. Note that not all the CD drives support these functions: Private Declare Function mciSendString Lib
‘————————————————-‘ 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
‘———————————————-‘ 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
‘————————————————–” 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
‘————————————————–” 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
‘ ————————————————————————‘ 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