DumpToJaggedArray
Dumps data from a source, or from the current instance, to a jagged array.
Syntax
expression.DumpToJaggedArray(OutPutArray, [DataSource:= Nothing])
Parameters
| Part | Description | 
|---|---|
| OutPutArray | Required. Identifier specifying a dynamic VariantType array variable. | 
| DataSource | Optional. Identifier specifying a CSVArrayListobject variable representing the data to copy from. | 
Returns value
None
📝Note
Before dump data, is required to make a call to the
ImportFromCSVorImportFromCSVstringmethod. The OutPutArray parameter must be declared as dynamicVarianttype 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 DumpToJaggedArray 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.
📝Note
The OutPutArray argument will contain a set of
Varianttype arrays. To access to an individual element user must use something like expression(i)(j), where i denotes an index in the main array and j denotes an index in the child array.
☕Example
Sub DumpToJaggedArrray()
    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
        .DumpToJaggedArray MyArray        'Dump the data to a jagged array
    End With
    Erase MyArray
    Set CSVint = Nothing
End Sub