Re: Multi Dimensional Array



Not sure I understand what your asking but this is exactly what I am trying
to accomplish. Currently I use something like:

MachineInfo = Array("Val0", "Val1", "Val2", "Val3", "Val4", "Val5", _
"Val6", "Val7", "Val8", "Val9", "Val10")
Call(Sub)

MachineInfo = Array("Val0", "Val1", "Val2", "Val3", "Val4", "Val5", _
"Val6", "Val7", "Val8", "Val9", "Val10")
Call(Sub)

MachineInfo = Array("Val0", "Val1", "Val2", "Val3", "Val4", "Val5", _
"Val6","Val7", "Val8", "Val9", "Val10")
Call(Sub)

I actually am doing this on about 40 machines, and what I am wanting to do
is something like this.

For i = 0 To 40
MachineInfo = Array(i, ("Val0", "Val1", "Val2", "Val3", "Val4", "Val5", _
"Val6","Val7", "Val8", "Val9", "Val10"))
Call(Sub)
Next

I figure it would save me about 80 lines of code if I can find anything on it.



Dave Marden



"JakeDAHS" wrote:

On Sep 22, 9:02 pm, "Dave Marden" <newsgr...@xxxxxxxxxxxxxxxx> wrote:
Currently I declare my arrays in this format:

MachineInfo = Array("Val0", "Val1", "Val2", "Val3", "Val4", "Val5", "Val6",
"Val7", "Val8", "Val9", "Val10")

What I am wondering now is if I can declare an entire array level at a time
such as something like:

MachineInfo = Array(0, ("Val0", "Val1", "Val2", "Val3", "Val4", "Val5",
"Val6", "Val7", "Val8", "Val9", "Val10"))
MachineInfo = Array(1, ("Val0", "Val1", "Val2", "Val3", "Val4", "Val5",
"Val6", "Val7", "Val8", "Val9", "Val10"))
MachineInfo = Array(2, ("Val0", "Val1", "Val2", "Val3", "Val4", "Val5",
"Val6", "Val7", "Val8", "Val9", "Val10"))

What I am trying to accomplish is to make something like:

For i = 1 to 3
WScript.Echo MachineInfo(i, (0))
WScript.Echo MachineInfo(i, (1))
WScript.Echo MachineInfo(i, (2))
WScript.Echo MachineInfo(i, (3))
WScript.Echo MachineInfo(i, (4))
WScript.Echo MachineInfo(i, (5))
WScript.Echo MachineInfo(i, (6))
WScript.Echo MachineInfo(i, (7))
WScript.Echo MachineInfo(i, (8))
WScript.Echo MachineInfo(i, (9))
WScript.Echo MachineInfo(i, (10))
Next

Otherwise instead of 40 lines of code to declare my variables, it will take
me 400, which will negate the positives I am looking for.

Any Help Would Be Appreciated,
Dave Marden

"Dave Marden" <newsgr...@xxxxxxxxxxxxxxxx> wrote in message

news:OvGAfoX$HHA.1188@xxxxxxxxxxxxxxxxxxxxxxx



Thanks I've actually been working on a program for a while and figured it
was one of those things in vbscript you just can't do with vbs.

Guess I have to learn to ask questions earlier.

Dave Marden

"JakeDAHS" <jskib...@xxxxxxxxx> wrote in message
news:1190505988.347411.53060@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Sep 22, 6:55 pm, "Dave Marden" <newsgr...@xxxxxxxxxxxxxxxx> wrote:
Is it possible to use multi-Dimensional Arrays?

I am thinking something like:
MachineInfo(1 To 40, 1 To 10) as it would be with Visual Basic, but I
don't
know the correct syntax or if it is possible. I have searched for
information but I cannot find anything on it.

Dave Marden

dim arr(1,4)

arr(0,0) = "test00"
arr(1,1) = "test10"
arr(1,2) = "test10"
arr(1,3) = "test10"
arr(1,4) = "test10"

for a = 0 to ubound(arr,1)
for b = 0 to ubound(arr,2)
wscript.echo a & vbtab & b & vbtab & arr(a,b)
next
next

-J
www.pooradmin.com- Hide quoted text -

- Show quoted text -

For your goal, is there a certain number of machines different
machines will hold say 10 values per machine?

-J
www.pooradmin.com


.



Relevant Pages

  • Re: Multi Dimensional Array
    ... What I am wondering now is if I can declare an entire array level at a time ... What I am trying to accomplish is to make something like: ... is there a certain number of machines different ...
    (microsoft.public.scripting.vbscript)
  • Re: Local Printers
    ... One way to accomplish this would be to create a special user group. ... case 'Local machine Admins' on the domain. ... > I run a military network so I keep the machines locked down as much as ... Some of the things users put on their machines can compromise ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Blocking a group of users from logging onto a wkstn.
    ... I want to block all students from logging onto a few specific machines computers. ... The student GPO is globally the same for all sites so this would affect all the sites if modified, the same with the teacher GPO. ... You can make additional GPOs if we can find an easy way for you to accomplish the goal. ... No, "Authenticated Users" is an AUTOMATIC group like Everyone, but essentially this idea is what Cary and I were discussing for you but using Users membership on the workstations and a group, either new and existing to grant the right ONLY to them by adding them to "Users" and removing the default "Domain Users" from it. ...
    (microsoft.public.win2000.active_directory)
  • Re: Re-activate 2nd-user machine?
    ... So what does the compulsory "activation" accomplish? ... packages preinstalled on machines often have the same key? ... launched the following message into cyberspace: ...
    (microsoft.public.windowsxp.general)
  • Re: Moving Files to new hardware
    ... >>and do to accomplish this? ... I appreciate any other insight in ... presuming your setup allows both machines to be online at the ... >time transfers. ...
    (freebsd-questions)