Jump to content

Have a loop create a multi-variable variable...


jack71
 Share

Recommended Posts

I have a loop that I want to have create a multi-variable variable, dumbed down ex:

local $test[0]
local $i = 1
 
For $i 1 to 20
local $test$i = _ArrayAdd($test$i, "Color" & $i)
local $test$i = _ArrayAdd($test$i, "Type" & $i)
Next

 

I want to retrieve some information via WMI and keep each device in its separate array but can't figure out how to create multivariable variables, if that's even possible.

I've tried declaring it as $test & $i, $test&$i, and $test($i) and it's not working.  I'm probably screwing up syntax somewhere?

Thanks :)

Link to comment
Share on other sites

Just trying to understand your direction...

I would build an "ini" file with the info

Use iniread() to build its own array/variable

8)

 

So is it not possible to create an array via loop with a number appended to it based on $i?

$i = 1 therefore $test1[0]

$i = 2 then...$test2[0]

I just don't know how many arrays I need to declare because it depends on the number of keys found in the registry.  

Edited by jack71
Link to comment
Share on other sites

Yes it is.

you need a two dimensional array ( multi-dimensional)

Like... $Test[0][0]

8)

 

I wanted to keep it simple.  For example if I have 2 network cards installed, 1 wifi, 1 LAN I want $test1 to contain all the information of the wifi card, and $test2 to contain all the information of the LAN card.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...