VB2005 Mehrdimensinonalas Array mit for each durchgehen
Moin,
wie kann ich ein Mehrdimensinonales Array mit for each durchgehen
Ich habe solch ein Array
arPath(0, 0) = "\\10.4.36.201\Stats\Burgdorf\Anforderungsblatt ZLB II.xls"
arPath(0, 1) = "Burgdorf"
arPath(1, 0) = "\\10.4.36.201\Stats\Celle\Anforderungsblatt ZLB II.xls"
arPath(0, 1) = "Celle"
arPath(2, 0) = "\\10.4.36.201\Stats\Detmold\Anforderungsblatt ZLB II.xls"
arPath(0, 1) = "Detmold"
Und möchte zum Beispiel eine MsgBox Ausgabe wechseln mit dem Pfad und dem Namen haben.
mit geht es nicht
For Each TempPath As String In arPath
MsgBox(TempPath(1), MsgBoxStyle.Information)
MsgBox(TempPath(0), MsgBoxStyle.Information)
next
und mit
For Each TempPath As String In arPath
For Each Temp2Path As String In TempPath
MsgBox(Temp2Path, MsgBoxStyle.Information)
Next
next
auch nicht.
wie kann ich ein Mehrdimensinonales Array mit for each durchgehen
Ich habe solch ein Array
arPath(0, 0) = "\\10.4.36.201\Stats\Burgdorf\Anforderungsblatt ZLB II.xls"
arPath(0, 1) = "Burgdorf"
arPath(1, 0) = "\\10.4.36.201\Stats\Celle\Anforderungsblatt ZLB II.xls"
arPath(0, 1) = "Celle"
arPath(2, 0) = "\\10.4.36.201\Stats\Detmold\Anforderungsblatt ZLB II.xls"
arPath(0, 1) = "Detmold"
Und möchte zum Beispiel eine MsgBox Ausgabe wechseln mit dem Pfad und dem Namen haben.
mit geht es nicht
For Each TempPath As String In arPath
MsgBox(TempPath(1), MsgBoxStyle.Information)
MsgBox(TempPath(0), MsgBoxStyle.Information)
next
und mit
For Each TempPath As String In arPath
For Each Temp2Path As String In TempPath
MsgBox(Temp2Path, MsgBoxStyle.Information)
Next
next
auch nicht.
Please also mark the comments that contributed to the solution of the article
Content-Key: 104127
Url: https://administrator.de/contentid/104127
Printed on: May 11, 2024 at 10:05 o'clock
3 Comments
Latest comment
arPath(0, 0) = "\\10.4.36.201\Stats\Burgdorf\Anforderungsblatt ZLB II.xls"
arPath(0, 1) = "Burgdorf"
arPath(1, 0) = "\\10.4.36.201\Stats\Celle\Anforderungsblatt ZLB II.xls"
arPath(0, 1) = "Celle"
arPath(2, 0) = "\\10.4.36.201\Stats\Detmold\Anforderungsblatt ZLB II.xls"
arPath(0, 1) = "Detmold"
hiermit hast du aber noch ein problem, da du immer den arraywert arpath(0,1) überschreibst. du musst dann auch das erste hochzählen.
arPath(0, 0) = "\\10.4.36.201\Stats\Burgdorf\Anforderungsblatt ZLB II.xls"
arPath(0, 1) = "Burgdorf"
arPath(1, 0) = "\\10.4.36.201\Stats\Celle\Anforderungsblatt ZLB II.xls"
arPath(1, 1) = "Celle"
arPath(2, 0) = "\\10.4.36.201\Stats\Detmold\Anforderungsblatt ZLB II.xls"
arPath(2, 1) = "Detmold"