insert data in 2 demensional array

dusti

Newcomer
Joined
Nov 8, 2003
Messages
1
Location
belgium - gent
hello all,

if I have a table like

Dim TblWerknemers As String(,) = {{"code", "3", "7", "8", "9", "10", "12", "13", "15"}, _
{"naam", "De Smet", "Janssens", "Pieters", "Cornelis", "De Smet", "Van Acker", "De Grootte", "Martens"}, _
{"afdeling", "marketing", "verkoop", "verkoop", "expeditie", "verwerking", "marketing", "verkoop", "verwerking"}, _
{"loon", "800", "900", "900", "750", "1000", "950", "1000", "850"}}


and I want to add extra values in the table, I first do
redim preserve tblwerknemers(tblwerknemers.getupperbound(0), tblwerknemers.getupperbound(1) +1)


then I dont know how to put new values in the table.
I know in theory how this works but I dont know how to write it

if anyone could point me to some usefull information or an example....


thanks

DuSti
 
First, I don't think you need the comma between the two parentheses. () should be fine.
And, for putting information into the table, just do this:

N = TblWerkNemers.GetUpperBound(1)
TblWerkNemers(0, N) = "16"
TblWerkNemers(1, N) = "Erikson"
TblWerkNemers(2, N) = "marketing"
TblWerkNemers(3, N) = "1000"
:)

Of course, you can load the data from somewhere, and just use variables:
TblWerkNemers(0, N) = sNewCode
 
Back
Top