creating an array of colors
ok this is weird, im trying to create an array of colors. approach 2 doesn't work and i do not know why
Code:
'approach 1: works
Dim list As Color() = New Color() {Color.FromArgb(255, 0, 0), Color.FromArgb(0, 255, 0), Color.FromArgb(0, 0, 255)}
Code:
'approach 2: fails.. why?
Dim list() As Color = New Color() {Color.FromArgb(255, 0, 0), Color.FromArgb(0, 255, 0), Color.FromArgb(0, 0, 255)}
if instead i wish to create an array of strings, both approach works, that's weird
Re: creating an array of colors
[Moved to VB.NET]
I tried both ways and it is working. If you are trying to use both of them together in the same block then you will receive an error saying that "local variable is already declared in the same block".
Re: creating an array of colors
Can't see why any of those would fail, didn't fail with me...