6105 Posted August 3, 2010 Share Posted August 3, 2010 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] Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 3, 2010 Share Posted August 3, 2010 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 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 Link to comment Share on other sites More sharing options...
Bert Posted August 3, 2010 Share Posted August 3, 2010 Create a second array and use ubound to reset it size each time you add an item. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now