Re: Playing with multidimensional array!?
- From: "McKirahan" <News@xxxxxxxxxxxxx>
- Date: Tue, 27 Nov 2007 22:30:11 -0600
"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: Claude Lachapelle
- Re: Playing with multidimensional array!?
- From: Tom Lavedas
- Re: Playing with multidimensional array!?
- From: Claude Lachapelle
- Re: Playing with multidimensional array!?
- Prev by Date: Re: Passing value to/from VBScript to Windows form application
- Next by Date: Re: NET SEND
- Previous by thread: Get Variable From Access Table Record
- Next by thread: Re: Playing with multidimensional array!?
- Index(es):
Relevant Pages
|