Sign in to follow this  
Followers 0
6105

Array help

3 posts in this topic

Hi,

Some body can help with array?

i want to ping every host and build script like this:

#include <Array.au3>

Global $avArray[10]
$avArray[0] = "F1WS1"
$avArray[1] = "F1WS2"
$avArray[2] = "F1WS3"
$avArray[3] = "F1WS4"
$avArray[4] = "F1WS5"
$avArray[5] = "F1WS6"
$avArray[6] = "F1WS7"
$avArray[7] = "F1WS8"
$avArray[8] = "F1WS10"
$avArray[9] = "F1WS12"

For $i =1 To 10
If Ping($avArray, True) Then
    MsgBox(64, "Yay", "Connected")
Else
    MsgBox(16, "Booo", "Not Connected")
EndIf
Next

But that don't work, i want to select just True Connected arrays, some body can help?

Thank you.


[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Share this post


Link to post
Share on other sites



You forgot the index, which is 0-based, by the way, so:

For $i = 0 To Ubound($avArray) - 1
     If Ping($avArray[$i], True) Then

     ;...

Next

:blink:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
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
Sign in to follow this  
Followers 0