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 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
orImportFromCSVstring
method. The OutPutArray parameter must be declared as dynamicVariant
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 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
Variant
type 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