t0ddie Posted July 29, 2005 Posted July 29, 2005 i have an array, and i want to show each variable in the array in a message box. but i really dont think this is the best way to do this, dim $var[10] $var[0] = hi $var[1] = hello $var[2] = hey $var[3] = howdy $var[4] = hiya $var[5] = yo $var[6] = greetings $var[7] = sup $var[8] = dude $var[9] = nice msgbox(0,"test",$var[0] & " " & $var[1] & " " & $var[2] & " " & $var[3] & " " &_ $var[4] & " " & $var[5] & " " & $var[6] & " " & $var[7] & " " & $var[8] & " " &_ $var[9]) is there a command, or a way to display every variable in an array without listing each of them in the code like i have shown above? Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
Josbe Posted July 29, 2005 Posted July 29, 2005 You can use the UDF: ArrayDisplay (included in the installation) Quote #include <Array.au3>_ArrayDisplay ( $avArray, $sTitle ) (check the helpfile) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
blindwig Posted July 29, 2005 Posted July 29, 2005 t0ddie said: i have an array, and i want to show each variable in the array in a message box....is there a command, or a way to display every variable in an array without listing each of them in the code like i have shown above?<{POST_SNAPBACK}>See my _Array1Box() function:http://www.autoitscript.com/forum/index.php?showtopic=12720It's an improvement on the _ArrayDisplay() function - it can display up to 4095 items of an array and can display 2d arrays as well. My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions
scriptkitty Posted July 29, 2005 Posted July 29, 2005 many ways to do it... $var=stringsplit("hi|hello|hey|howdy|hiya|yo|greetings|sup|dude|nice","|") $out="" for $i=1 to $var[0] $out=$out & $var[$i] & " " next msgbox(0,"test",$out) ; random greeting... $ran=random(1,$var[0]+1) msgbox(1,"greeting is",$var[$ran]) AutoIt3, the MACGYVER Pocket Knife for computers.
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