Cap0 Posted May 5, 2007 Posted May 5, 2007 Dim $arr[4] For $i = 0 to 3 - 1 $arr[$i] = int(random(0,10)) Next what i want to do is get the values and display as strings: example: msgbox(0,'',$arr[0] & $arr[1] & $arr[2]) how would i do it in a for next loop without writing $arr[0-2]? so the output would be, say 123($arr[0] = 1, $arr[1] = 2, $arr[2] = 3).
randallc Posted May 5, 2007 Posted May 5, 2007 (edited) Hi, Here's 2 ways; ;ex01.au3 ;ex01.au3 #include<array.au3> Dim $arr[4], $msg For $i = 0 To UBound($arr) - 1 $arr[$i] = Int(Random(0, 10)) $msg &= "$arr[" & $i & "]=" & $arr[$i] & "," Next MsgBox(0, "", $msg) _ArrayDisplay($arr, "$arr elements")Randall Edited May 5, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
Cap0 Posted May 5, 2007 Author Posted May 5, 2007 (edited) Thanks, works great Edited May 5, 2007 by Cap0
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