BlueScreen Posted April 6, 2006 Share Posted April 6, 2006 (edited) Hi all, I have created 2 arrays and want to sort them. I have created a function which receives the array and sort it. Its working well, but I want to be able to print using a msgbox that the array is sorted. I would like to do it inside the function. How can I get the name of the parameter introduced to the func? #include <array.au3> Dim $myArray1[3] Dim $myArray2[3] $myArray1[0]="98" $myArray1[1]="67" $myArray1[2]="12" $myArray2[0]="44" $myArray2[1]="22" $myArray2[2]="11" sort ($myArray1) sort ($myArray2) Func sort ($array) _ArraySort ($array,0,0,0) msgbox (0,"","The array: " & $array & " was sorted.") EndFunc Edited April 6, 2006 by BlueScreen Link to comment Share on other sites More sharing options...
nfwu Posted April 6, 2006 Share Posted April 6, 2006 You can't (as far as I know). 1 work-around solution:#include <array.au3> Dim $myArray1[3] Dim $myArray2[3] $myArray1[0]="98" $myArray1[1]="67" $myArray1[2]="12" $myArray2[0]="44" $myArray2[1]="22" $myArray2[2]="11" sort ($myArray1, "$myArray1") sort ($myArray2, "$myArray2") Func sort ($array, $name) _ArraySort ($array,0,0,0) msgbox (0,"","The array: " & $name & " was sorted.") EndFunc #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
nfwu Posted April 6, 2006 Share Posted April 6, 2006 Hmmm... I noticed another thread discussing the same thing:http://www.autoitscript.com/forum/index.php?showtopic=24294Didn't seem to get any easy-to-use solution though.#) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
BlueScreen Posted April 6, 2006 Author Share Posted April 6, 2006 Thanks, guys for your help. I'll check the thread... 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