reflect.Value.clear

Removes all elements of the reflect.Value referencing a collection.

Syntax

clear( )

Usage

The clear() method clears the dynamic array or dictionary referenced by this reflect.Value object.

The reflect.Value object used to call this method must have been created from a DYNAMIC ARRAY, a DICTIONARY variable, or is a reflect.Value object returned from a method like getField(), and references a dynamic array or dictionary.

Example

IMPORT reflect
MAIN
    DEFINE val reflect.Value
    DEFINE arr DYNAMIC ARRAY OF STRING
    LET arr[1] = "elem1"
    LET arr[2] = "elem2"
    LET val = reflect.Value.valueOf(arr)
    CALL val.clear()
    DISPLAY "arr len =", arr.getLength()
END MAIN
Shows:
arr len =          0