Skip to main content Link Search Menu Expand Document (external link) Copy Copied

DumpToArray

Dumps data from a source, or from the current instance, to an array.


Syntax

expression.DumpToArray(OutPutArray, [DataSource:= Nothing])

Parameters

Part Description
OutPutArray Required. Identifier specifying a dynamic Variant Type array variable.
DataSource Optional. Identifier specifying a CSVArrayList object variable representing the data to copy from.

Returns value

None

📝Note

Before dump data, is required to make a call to the ImportFromCSV or ImportFromCSVstring method. The OutPutArray parameter must be declared as dynamic Variant type array. If user forget to do this, an error can occur.

See also
ImportFromCSV method, ImportFromCSVstring method.

Behavior

When the DataSource parameter is omitted the DumpToArray method makes a copy of all data stored in the current instance. If the user specified a data source, its data is copied and returned in the OutPutArray parameter.

⚠️Caution

The data is always returned in a Two-dimensional array, even when the imported file only contain a field per record.

☕Example

Sub DumpToArrray()
    Dim CSVint As CSVinterface
    Dim MyArray() As Variant
    
    Set CSVint = New CSVinterface
    With CSVint.parseConfig
        .path = Environ("USERPROFILE") & "\Desktop\Demo_100000records.csv"
    End With
    With CSVint
        .ImportFromCSV .parseConfig       'Import CSV data
        .DumpToArray MyArray              'Dump the data to an array
    End With
    Erase MyArray
    Set CSVint = Nothing
End Sub

Back to Methods overview