J
Juggernath
Is there some elegant way to assign values to array, for ex:
dim A(3) as integer {1,2,4}
instead of
dim A(3) as integer
A(1)=1
A(2)=2
A(3)=4
dim A(3) as integer {1,2,4}
instead of
dim A(3) as integer
A(1)=1
A(2)=2
A(3)=4
I tried it already... it says "cannot assign to array" when it comes to 2ndNorman Jones said:Hi Juggernath,
One possibility:
Dim arr As Variant
arr = Array(1, 2, 4)
If the functions in the freely downloadable file atJuggernath said:Is there some elegant way to assign values to array, for ex:
dim A(3) as integer {1,2,4}
instead of
dim A(3) as integer
A(1)=1
A(2)=2
A(3)=4
Thanks for trying to help so far...Norman Jones said:Hi Juggernath,
As Bob suggests, the code worked in my test.
How did you dim your array?
Norman Jones said:Hi Bob,
You used a mere four words to convey what took me an entire post!
Unfortunately, when I responded your post was not visible - to me!
Well, with respect to being to the point, the responders are suggesting
code to load a Variant() type array, while the OP is looking to load a
Double() type array, and never the twain shall meet.
the responders are suggesting code to load a Variant() type array
the OP is looking to load a Double() type array, and never the twain shall
meet.
Norman said:Hi Alan,
The OP's initial post said:
'========================
Is there some elegant way to assign values to array, for ex:
dim A(3) as integer {1,2,4}
instead of
dim A(3) as integer
A(1)=1
A(2)=2
A(3)=4
'========================
My response was directed to that question.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.