Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference > Siebel VB Language Reference >
Erase Statement
This standard VB statement reinitializes the contents of a fixed array or frees the storage associated with a dynamic array.
Syntax
Erase Array[, Array]
Returns
Not applicable
Usage
The effect of using Erase on the elements of a fixed array varies with the type of the element:
Example
This example prompts for a list of item numbers to put into an array and clears the array if the user wants to start over.
Sub Button_Click
Dim msgtext
Dim inum(100) as Integer
Dim x, count
Dim newline
newline = Chr(10)
x = 1
count = x
inum(x) = 0
Do
inum(x) = x + 1
If inum(x) = 99 then
Erase inum()
x = 0
ElseIf inum(x) = 0 then
Exit Do
End If
x = x + 1
Loop
count = x-1
msgtext = "You entered the following numbers:" & newline
For x = 1 to count
TheApplication.TraceOn "c:\temp\trace.txt", "Allocation", "All"
TheApplication.Trace msgtext & inum(x) & newline
Next x
End SubSee Also
Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference Published: 18 June 2003 |