von Stephan » Do, 05.09.2019 13:03
falsch ist:
dim noshow(3,1) as integer
-->Du kannst nicht ein Array als Integer definieren, wenn es seinerseits Arrays enthalten soll
deshalb, z.B.:
noshow()=array(array(1,2,3,4),array(5,6,7,8))
-->Du kannst nicht eine Variable in dieser Weise mit Inhalt belegen wenn Du sie bereits vorher anders definiert hast
deshalb z.B.:
print noshow(0,0)
-->Du kannst nicht ein Array anzeigen lassen, sondern immer nur Elemente eines Array
deshalb, z.B.:
insgesamt also z.B.:
Code: Alles auswählen
dim noshow(3,1) as Variant
noshow(0,0)=array(1,2,3,4) 'd.h. nur eine Zelle des Arrays ist hier
'belegt, 7 Zellen sind noch frei
x = noshow(0,0) 'x enthält dadurch das Array aus noshow(0,0)
Print x(0) 'angezeigt wird nur der erste Wert (Index 0) des Arrays x
oder auch (in anderer Interpretation dessen was Du mutmaßlich erreichen wolltest):
Code: Alles auswählen
Dim noshow() As Variant 'ohne Dimension
noshow()=array(array(1,2,3,4),array(5,6,7,8)) 'klappt nun
print noshow(0,0) (0) 'verkürze Schreibweise (statt x = noshow(0,0) ... Print x(0))
Gruß
Stephan
falsch ist:
[quote]dim noshow(3,1) as integer[/quote]
-->Du kannst nicht ein Array als Integer definieren, wenn es seinerseits Arrays enthalten soll
deshalb, z.B.:
[code]dim noshow(3,1) as Variant
[/code][quote]noshow()=array(array(1,2,3,4),array(5,6,7,8))
[/quote]
-->Du kannst nicht eine Variable in dieser Weise mit Inhalt belegen wenn Du sie bereits vorher anders definiert hast
deshalb z.B.:
[code]noshow(0,0)=array(1,2,3,4)
[/code]
[quote]print noshow(0,0)
[/quote]
-->Du kannst nicht ein Array anzeigen lassen, sondern immer nur Elemente eines Array
deshalb, z.B.:
[code]x = noshow(0,0)
Print x(0)
[/code]
insgesamt also z.B.:
[code]dim noshow(3,1) as Variant
noshow(0,0)=array(1,2,3,4) 'd.h. nur eine Zelle des Arrays ist hier
'belegt, 7 Zellen sind noch frei
x = noshow(0,0) 'x enthält dadurch das Array aus noshow(0,0)
Print x(0) 'angezeigt wird nur der erste Wert (Index 0) des Arrays x [/code]
oder auch (in anderer Interpretation dessen was Du mutmaßlich erreichen wolltest):
[code]Dim noshow() As Variant 'ohne Dimension
noshow()=array(array(1,2,3,4),array(5,6,7,8)) 'klappt nun
print noshow(0,0) (0) 'verkürze Schreibweise (statt x = noshow(0,0) ... Print x(0))
[/code]
Gruß
Stephan