[Gambas-user] How to make an array

T Lee Davidson t.lee.davidson at gmail.com
Wed May 6 15:40:50 CEST 2020


On 5/6/20 4:59 AM, Dag Jarle Nerland Johansen - Gambas wrote:
> Hi,
> thanks, but that confuses even more
> 
> Am 05.05.20 um 16:21 schrieb T Lee Davidson:
>> On 5/5/20 8:39 AM, Dag Jarle Nerland Johansen - Gambas wrote:
>>> Hi,
>>> I got unsure how to create a dynamic two-dimensional array.
>>> I need to read in a CSV for processing addresses.
>>> That means a variable length of the array, but the field numbers are always the same.
>>> forename, surename, mail ...
>>> Can anyone help,
>>> thanks,
>>> (I know I should know this by now but I only program now and then with long pauses in between)
>>> Dag
>>
>> Perhaps an array of Collection (Collection[]) would be better suited.

Public Sub Main()

   Dim hCsvFile As CsvFile
   Dim aLines As Collection[]

   hCsvFile = New CsvFile("MyCsvFile.csv", ",")
   While Not hCsvFile.Eof
     aLines.Add(hCsvFile.Read)
   Wend

End


http://gambaswiki.org/wiki/comp/gb.util/csvfile

-- 
Lee


More information about the User mailing list