Re: Playing with multidimensional array!?
- From: Claude Lachapelle <ClaudeLachapelle@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 28 Nov 2007 05:22:01 -0800
Thanks a lot for your help.
Correct me if I'm wrong (I really found that unusual!), but when accessing
data into the two dimensions array, the first parameters is always the
column, and the second one the row...
I'm always confused with that since others old programming languages are
functionning by beginning by the row...
"McKirahan" wrote:
"Claude Lachapelle" <ClaudeLachapelle@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in.
message news:6F901599-03E5-4C95-BD8E-BAC64FE14AE2@xxxxxxxxxxxxxxxx
Hi!dimension
I need to play with a multidimensional array in VBScript, but I`m about to
turn crazy with the way they are implemented into VBScript!
I need to start with an empty array, and start filling it with two
data like:Exchange
Row 1, Column 1 = mailbox.LegacyDN
Row 1, Column 2 = mailbox.ServerName
Row 1, Column 3 = mailbox.LastLogonTime
Row 1, Column 4 = mailbox.Size
Row 2, Column 1 = mailbox.LegacyDN
Row 2, Column 2 = mailbox.ServerName
Row 2, Column 3 = mailbox.LastLogonTime
Row 2, Column 4 = mailbox.Size
and so on... and after gathering all mailboxes informations on all
Servers, I will be able to match Active Directory Users by seeking thistable
for thethe
corresponding ExchangeLegacyDN.
Actually, I'm defining the array with Dim aMailboxes(), and adding data to
it by using the REDIM PRESERVE, but where I'm really confused, it is how
REDIM the two dimension and after that, assigning values to the new Row
added... someone expert or familiar with that could help me?
You can only ReDim the last dimension (in your case "Rows");
thus, your array may look like:
Dim aMailboxes()
ReDim aMailboxes(3,0)
'* aMailboxes(0,#) = mailbox.LegacyDN
'* aMailboxes(1,#) = mailbox.ServerName
'* aMailboxes(2,#) = mailbox.LastLogonTime
'* aMailboxes(3,#) = mailbox.Size
Dim iMailboxes
iMailboxes = 0
ReDim Preserve aMailboxes(UBound(aMailboxes,1),iMailboxes)
aMailboxes(0,iMailboxes) = LegacyDN...
aMailboxes(1,iMailboxes) = ServerName...
aMailboxes(2,iMailboxes) = LastLogonTime...
aMailboxes(3,iMailboxes) = Size...
iMailboxes = iMailboxes + 1
- Follow-Ups:
- Re: Playing with multidimensional array!?
- From: Tom Lavedas
- Re: Playing with multidimensional array!?
- From: McKirahan
- Re: Playing with multidimensional array!?
- References:
- Re: Playing with multidimensional array!?
- From: McKirahan
- Re: Playing with multidimensional array!?
- Prev by Date: Re: VB script
- Next by Date: Re: Playing with multidimensional array!?
- Previous by thread: Re: Playing with multidimensional array!?
- Next by thread: Re: Playing with multidimensional array!?
- Index(es):
Relevant Pages
|