Doc: ClearArray

ClearArray - set all the elements of an array to a value.

Syntax

ClearArray arrayName, value

  • arrayName - name of the array to fill
  • value - value to set all of the array's elements to

Explanation

ClearArray sets all the elements of an array to a value. It is useful for resetting or initializing an array.

Examples

Clear an Array

After the array is created, all the elements are set to "dar…".

SetFPS 60

; create array
Dim dumbGuySays$(3)

; clear the array
ClearArray dumbGuySays$(), "dar.."
Do
    Cls 0
        Print "Dumb guy says :"
        For i = 1 to GetArrayElements(dumbGuySays$(),1)
            Print dumbGuySays$(i)
        Next
    Sync
Loop

Related Pages

Categories: Arrays : Data : Functions
page tags: array clear function