Skip to content

Commit cd66204

Browse files
authored
Merge pull request #14 from ws-garcia/VBA-CSV-Interface-New-Version
Vba csv interface new version
2 parents 9dd1e57 + 2e51e66 commit cd66204

14 files changed

+263
-75
lines changed

docs/api/methods/createjagged.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: CreateJagged
3+
parent: Methods
4+
grand_parent: API
5+
nav_order: 1
6+
---
7+
8+
# CreateJagged
9+
{: .d-inline-block }
10+
11+
New
12+
{: .label .label-purple }
13+
14+
Creates an empty array of vectors, each of which having a fixed custom size.
15+
{: .fs-6 .fw-300 }
16+
17+
---
18+
19+
## Syntax
20+
21+
*expression*.`CreateJagged`*(ArrVar, ArraySize, VectorSize)*
22+
23+
### Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th style="text-align: left;">Part</th>
29+
<th style="text-align: left;">Description</th>
30+
</tr>
31+
</thead>
32+
<tbody>
33+
<tr>
34+
<td style="text-align: left;"><em>ArrVar</em></td>
35+
<td style="text-align: left;">Required. Identifier specifying a dynamic <code>Variant</code> Type array variable.</td>
36+
</tr>
37+
<tr>
38+
<td style="text-align: left;"><em>ArraySize</em></td>
39+
<td style="text-align: left;">Required. Identifier specifying a <code>Long</code> Type variable. Must be greater or equal to zero.</td>
40+
</tr>
41+
<tr>
42+
<td style="text-align: left;"><em>VectorSize</em></td>
43+
<td style="text-align: left;">Required. Identifier specifying a <code>Long</code> Type variable. Must be greater or equal to zero.</td>
44+
</tr>
45+
</tbody>
46+
</table>
47+
48+
>⚠️**Caution**
49+
>{: .text-grey-lt-000 .bg-green-000 }
50+
>Setting the *ArraySize* or the *VectorSize* parameter to a value less than zero will generate a runtime error.
51+
{: .text-grey-dk-300 .bg-yellow-000 }
52+
53+
### Return value
54+
55+
_None_
56+
57+
---
58+
59+
## Behavior
60+
61+
The *ArraySize* parameter is used by the `CreateJagged` method to resize the *ArrVar* array. In the same way, the *VectorSize* parameter is used for set the sizes of `String` Type vectors.
62+
63+
>📝**Note**
64+
>{: .text-grey-lt-000 .bg-green-000 }
65+
>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.
66+
{: .text-grey-dk-300 .bg-grey-lt-000 }
67+
68+
[Back to Methods overview](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/)

docs/api/methods/dumptoarray.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: DumpToArray
33
parent: Methods
44
grand_parent: API
5-
nav_order: 1
5+
nav_order: 2
66
---
77

88
# DumpToArray
@@ -41,4 +41,9 @@ The `DumpToArray` method make a copy of all the data stored in the current insta
4141

4242
The dumped data will be successively erased from memory, in other words, the current instance will doesn't hold the read CSV data any more. In the same way, the `DumpToArray` method doesn’t perform any modifications to the *OutPutArray* array for subsequent calls not preceded by one `ImportFromCSV` or `ImportFromCSVstring` method call.
4343

44+
>⚠️**Caution**
45+
>{: .text-grey-lt-000 .bg-green-000 }
46+
>The data is always returned in a Two-dimensional array, even when the imported CSV file only contain a field per record.
47+
{: .text-grey-dk-300 .bg-yellow-000 }
48+
4449
[Back to Methods overview](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/)

docs/api/methods/dumptojaggedarray.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: DumpToJaggedArray
33
parent: Methods
44
grand_parent: API
5-
nav_order: 2
5+
nav_order: 3
66
---
77

88
# DumpToJaggedArray

docs/api/methods/dumptosheet.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: DumpToSheet
33
parent: Methods
44
grand_parent: API
5-
nav_order: 3
5+
nav_order: 4
66
---
77

88
# DumpToSheet
@@ -29,15 +29,15 @@ Dumps the data from the current instance to an Excel WorkSheet.
2929
<tbody>
3030
<tr>
3131
<td style="text-align: left;"><em>WBookName</em></td>
32-
<td style="text-align: left;">Optional. Identifier specifying a <code>String</code> variable representing the output Workbook name.</td>
32+
<td style="text-align: left;">Optional. Identifier specifying a <code>String</code> Type variable representing the output Workbook name.</td>
3333
</tr>
3434
<tr>
3535
<td style="text-align: left;"><em>SheetName</em></td>
36-
<td style="text-align: left;">Optional. Identifier specifying a <code>String</code> variable representing the output Worksheet name.</td>
36+
<td style="text-align: left;">Optional. Identifier specifying a <code>String</code> Type variable representing the output Worksheet name.</td>
3737
</tr>
3838
<tr>
3939
<td style="text-align: left;"><em>RngName</em></td>
40-
<td style="text-align: left;">Optional. Identifier specifying a <code>String</code> variable representing the name of the output top left-most range.</td>
40+
<td style="text-align: left;">Optional. Identifier specifying a <code>String</code> Type variable representing the name of the output top left-most range.</td>
4141
</tr>
4242
</tbody>
4343
</table>

docs/api/methods/exporttocsv.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ExportToCSV
33
parent: Methods
44
grand_parent: API
5-
nav_order: 4
5+
nav_order: 5
66
---
77

88
# ExportToCSV
@@ -29,11 +29,11 @@ Exports an array's content to a CSV file.
2929
<tbody>
3030
<tr>
3131
<td style="text-align: left;"><em>csvArray</em></td>
32-
<td style="text-align: left;">Required. Identifier specifying a <code>Variant</code> array variable.</td>
32+
<td style="text-align: left;">Required. Identifier specifying a <code>Variant</code> Type variable.</td>
3333
</tr>
3434
<tr>
3535
<td style="text-align: left;"><em>PassControlToOS</em></td>
36-
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> variable.</td>
36+
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> Type variable.</td>
3737
</tr>
3838
</tbody>
3939
</table>
@@ -44,7 +44,7 @@ _None_
4444

4545
>📝**Note**
4646
>{: .text-grey-lt-000 .bg-green-000 }
47-
>Before invoke the `ExportToCSV` method, the user must to open a connection to the CSV file. The *csvArray* parameter must be declared as `Variant` array. Passing a variable that isn't an array will cause an error and the operation aborts.
47+
>Before invoke the `ExportToCSV` method, the user must to open a connection to the CSV file. Passing a variable that isn't an array will cause an error and the operation aborts.
4848
{: .text-grey-dk-300 .bg-grey-lt-000 }
4949

5050
See also
@@ -54,11 +54,6 @@ See also
5454

5555
## Behavior
5656

57-
>⚠️**Caution**
58-
>{: .text-grey-lt-000 .bg-green-000 }
59-
If the `QuotingMode` property is set to `QuotationMode.Critical` and the *csvArray* argument points to a jagged array, the *csvArray* array will be turn to a `Variant` Type Two-dimensional array for hold string data. Use jagged arrays keeping in mind they can make the VBA hosting application run out of memory.
60-
{: .text-grey-dk-300 .bg-yellow-000 }
61-
6257
The `FieldsDelimiter`, `RecordsDelimiter` and `EscapeChar` properties sets the method's behavior to the needs.
6358

6459
[Back to Methods overview](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/)

docs/api/methods/getdatafromcsv.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: GetDataFromCSV
33
parent: Methods
44
grand_parent: API
5-
nav_order: 5
5+
nav_order: 6
66
---
77

88
# GetDataFromCSV
@@ -19,7 +19,7 @@ Dumps a CSV file content to a string variable
1919

2020
### Parameters
2121

22-
The required *csvPathAndFilename* argument is an identifier specifying a `String` variable.
22+
The required *csvPathAndFilename* argument is an identifier specifying a `String` Type variable.
2323

2424
### Return value
2525

docs/api/methods/importfromcsv.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ImportFromCSV
33
parent: Methods
44
grand_parent: API
5-
nav_order: 6
5+
nav_order: 7
66
---
77

88
# ImportFromCSV
@@ -29,11 +29,11 @@ Imports a CSV file's content to the current instance.
2929
<tbody>
3030
<tr>
3131
<td style="text-align: left;"><em>HeadersOmission</em></td>
32-
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> variable.</td>
32+
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> Type variable.</td>
3333
</tr>
3434
<tr>
3535
<td style="text-align: left;"><em>PassControlToOS</em></td>
36-
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> variable.</td>
36+
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> Type variable.</td>
3737
</tr>
3838
</tbody>
3939
</table>

docs/api/methods/importfromcsvstring.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ImportFromCSVstring
33
parent: Methods
44
grand_parent: API
5-
nav_order: 7
5+
nav_order: 8
66
---
77

88
# ImportFromCSVstring
@@ -29,15 +29,15 @@ Parses a string and save its CSV data to the current instance.
2929
<tbody>
3030
<tr>
3131
<td style="text-align: left;"><em>CSVstring</em></td>
32-
<td style="text-align: left;">Required. Identifier specifying a <code>String</code> variable to be parsed.</td>
32+
<td style="text-align: left;">Required. Identifier specifying a <code>String</code> Type variable to be parsed.</td>
3333
</tr>
3434
<tr>
3535
<td style="text-align: left;"><em>HeadersOmission</em></td>
36-
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> variable.</td>
36+
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> Type variable.</td>
3737
</tr>
3838
<tr>
3939
<td style="text-align: left;"><em>PassControlToOS</em></td>
40-
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> variable.</td>
40+
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> Type variable.</td>
4141
</tr>
4242
</tbody>
4343
</table>

docs/api/methods/isjaggedarray.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: IsJaggedArray
3+
parent: Methods
4+
grand_parent: API
5+
nav_order: 9
6+
---
7+
8+
# IsJaggedArray
9+
{: .d-inline-block }
10+
11+
New
12+
{: .label .label-purple }
13+
14+
Checks if the given array is an array of arrays.
15+
{: .fs-6 .fw-300 }
16+
17+
---
18+
19+
## Syntax
20+
21+
*expression*.`IsJaggedArray`*(Arr)*
22+
23+
### Parameters
24+
25+
The required *Arr* argument is an identifier specifying a `Variant` Type variable.
26+
27+
### Return value
28+
29+
*Type*: `Boolean`
30+
31+
---
32+
33+
## Behavior
34+
35+
>⚠️**Caution**
36+
>{: .text-grey-lt-000 .bg-green-000 }
37+
>If the *Arr* parameter doesn’t hold an array, the `IsJaggedArray` method will return `False`.
38+
{: .text-grey-dk-300 .bg-yellow-000 }
39+
40+
[Back to Methods overview](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: JaggedToTwoDimArray
3+
parent: Methods
4+
grand_parent: API
5+
nav_order: 10
6+
---
7+
8+
# JaggedToTwoDimArray
9+
{: .d-inline-block }
10+
11+
New
12+
{: .label .label-purple }
13+
14+
Deconstructs a jagged array and puts its content into a 2D string array.
15+
{: .fs-6 .fw-300 }
16+
17+
---
18+
19+
## Syntax
20+
21+
*expression*.`JaggedToTwoDimArray`*(JaggedArray, TwoDimArray)*
22+
23+
### Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th style="text-align: left;">Part</th>
29+
<th style="text-align: left;">Description</th>
30+
</tr>
31+
</thead>
32+
<tbody>
33+
<tr>
34+
<td style="text-align: left;"><em>JaggedArray</em></td>
35+
<td style="text-align: left;">Required. Identifier specifying a dynamic <code>Variant</code> Type array variable.</td>
36+
</tr>
37+
<tr>
38+
<td style="text-align: left;"><em>TwoDimArray</em></td>
39+
<td style="text-align: left;">Required. Identifier specifying a dynamic <code>String</code> Type array variable.</td>
40+
</tr>
41+
</tbody>
42+
</table>
43+
44+
### Return value
45+
46+
_None_
47+
48+
---
49+
50+
## Behavior
51+
52+
>⚠️**Caution**
53+
>{: .text-grey-lt-000 .bg-green-000 }
54+
>The *JaggedArray* parameter must hold a set of `String` type arrays, and will be successively deconstructed and erased by the `JaggedToTwoDimArray` method passing its content to the *TwoDimArray* parameter.
55+
{: .text-grey-dk-300 .bg-yellow-000 }
56+
57+
[Back to Methods overview](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/)

0 commit comments

Comments
 (0)