|
-
Apr 2nd, 2003, 10:48 AM
#1
Thread Starter
PowerPoster
Multi Array
What do you think of doing an array like this?
Code:
redim preserve aData(i)
aData(i) = array(strTypeSelected, strHTML)
-
Apr 2nd, 2003, 11:04 AM
#2
I wonder how many charact
Well, I wouldn't like you very much for implementing that in any project we worked on together... but if it works and takes far less code than the alternative, more to ya...
-
Apr 2nd, 2003, 11:06 AM
#3
PowerPoster
Re: Multi Array
Originally posted by jesus4u
What do you think of doing an array like this?
Code:
redim preserve aData(i)
aData(i) = array(strTypeSelected, strHTML)
are those arguments really strings? that might cause some problems ...
-
Apr 2nd, 2003, 11:07 AM
#4
PowerPoster
-
Apr 2nd, 2003, 12:04 PM
#5
Thread Starter
PowerPoster
-
Apr 2nd, 2003, 05:58 PM
#6
I wonder how many charact
Well if its a function, I don't understand what you are asking about? All you are doing is assigning a value to an element in an array.
-
Apr 2nd, 2003, 06:03 PM
#7
Stuck in the 80s
You mean something like this:
VB Code:
Dim iCoords(0) As Variant
iCoords(0) = Array(1, 2)
MsgBox UBound(iCoords(0))
Pretty interesting, although I couldn't get it to work with anything but Variant.
-
Apr 2nd, 2003, 06:05 PM
#8
Stuck in the 80s
Originally posted by nemaroller
Well if its a function, I don't understand what you are asking about? All you are doing is assigning a value to an element in an array.
Actually, he's creating a multidimensional array from a one-dimensional array, like in the code I posted above.
-
Apr 2nd, 2003, 09:19 PM
#9
PowerPoster
i still dont get the point of the thread ... is there something new or clever there that I am missing?
-
Apr 2nd, 2003, 09:55 PM
#10
Stuck in the 80s
Originally posted by Muddy
i still dont get the point of the thread ... is there something new or clever there that I am missing?
I believe he's asking whether or not it's a good method to use, or if he should declare them as multi-dimensional, to which I don't know the answer.
But then again, I'm not him, so I can only speculate what he's asking.
-
Apr 2nd, 2003, 10:51 PM
#11
New Member
You may just want to point an array to a type.
Type udt_something
strTypeSelected as string
strHTML as string
end type
dim aData() as udt_something
aData(i).strTypeSelected = "Something"
aData(i).strHTML = "HTML String"
-
Apr 3rd, 2003, 06:35 AM
#12
PowerPoster
seems to me that:
if you were wanting to conserve memory then this might save some (how much depends on how big the array is)
if you were wanting to conserve processor usage then a 2-d array would save some usage (how much depends on how many times the array is accessed)
Either way, if it is resource optimization that your after, you would probably be "splitting hairs" worrying about it at all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|