Leaderboard
Popular Content
Showing content with the highest reputation on 07/21/2021 in all areas
-
create a Word Frequency Counter
JockoDundee and 2 others reacted to Earthshine for a topic
is this a homework question? 😀 (i had this assignment in pascal in college... lol)3 points -
Why? It's a fantastic visual assist and makes for faster reading and especially troubleshooting ... no doubt why it was implemented.3 points
-
(Poll) What features do you wish you had in AutoIt?
TheDcoder and one other reacted to JockoDundee for a topic
Also nice would be the ability to write nested arrays instead of just read them with ([])[] syntax, (or better).2 points -
1 point
-
create a Word Frequency Counter
TheDcoder reacted to JockoDundee for a topic
Not the first time VinnyMS has been hit with such an allegation1 point -
Think I've found the regression which was introduced by the changes I've made for Please check this Beta v3.3.15.5 of au3check to see what other things I've broken.1 point
-
AutoIt v3.3.15.4 Beta
argumentum reacted to Jos for a topic
Ok thanks .... I will see which change I/we've made that is the reason for this one.....1 point -
WebDriver UDF - Help & Support (III)
Danp2 reacted to seadoggie01 for a topic
@samibb That element doesn't have a named value, so it won't return anything. You'll want to get the xPath to the <code> element (below id="responseCommand"), then possibly get the "text" instead of the "value" using _WD_ElementAction. The key to learning about these things is to try a few different things. Mess with it, the worst that happens is you learn 5 ways not to complete your task Edit: This is silly, stop beating me to the punch, Danp21 point -
(Poll) What features do you wish you had in AutoIt?
TheDcoder reacted to argumentum for a topic
I don't see C, or C see. I don't know C. But when the chatter is not getting anywhere I wanna see code. Once I see the code, I have something that I can look at. So I'd propose to share the C code that does what one would like included, if the person can read/write C, share that for evaluation of a yey/nay integration into the product. Otherwise we would have to hope that what we wish, can be easily implemented by the god like master* *to me those that can see C, are almighty and there is nothing that can escape their infinite experience coding my dreams.1 point -
WebDriver UDF - Help & Support (III)
Danp2 reacted to seadoggie01 for a topic
@Danp2 The leading space is truncated. In JavaScript, document.getElementById("CustomCode113ID").children[0].label returns the text truncated as well, so I would say the functionality is correct @samibb _WD_ElementAction($sSession, $sElement, $sCommand, $sOption = Default) and use "value" for $sCommand1 point -
In no particular order, without changing the fundaments of the language: Some form of file scope for variables (and functions?) or namespaces. E.g. in a source file, Restrict $a = 12345 would declare a variable $a for this file only. Ability to read/write any subarray: say we have $a[3][2][4], then $a[1][0] would evaluate to the 1D array formed by $a[1][0][0..3]. $a[1] would eval to the 2D subarray $a[1][0..1][0..3] Ability to create arrays from a text statement using Execute (like https://www.autoitscript.com/trac/autoit/ticket/3702) Ability to pass blank arguments to functions (that or named arguments): fct($a, , "abcd", , 47) would mean fct($a, Default, "abcd", Default, 47) Extend the max number of cells (currently 2²⁴) in an array, possibly using a pragma Atomic exchange of 2 variables (including array elements or sub-arrays) without having to make 3 copies with intermediate variable: $a >< $b Lists + list functions Ability to modify the actual element that the running variable $x represents in For .. In constructs: For $x in $aArray ... $x! &= "abc" would apply to what $x currently "points to", while $x &= "abc" would only change $x locally and not the array element (as it currently does). Allow assignments during evaluation (as previously mentionned) ... to be continued!1 point
-
(Poll) What features do you wish you had in AutoIt?
TheDcoder reacted to Earthshine for a topic
it matters because because it scales well and debloats the output. it matters on large scales stuff. He's a perfomance guy... that's a good thing in my book. He's talking about a smart linker that only pulls what's necessary into the executable so it's not a fat, bloated piece of software1 point -
(Poll) What features do you wish you had in AutoIt?
TheDcoder reacted to Earthshine for a topic
that is what I thought he was doing.. lol, gathering input specs for EasyCodeIt, but who cares, I voted. Do it up. If EasyCodeIt had all that stuff too I would use it on Linux if I ever migrate. My dev and work stuff would never care... I might because I don't like win11 really all that much.1 point -
(Poll) What features do you wish you had in AutoIt?
TheDcoder reacted to JockoDundee for a topic
Autoit already has some reflection, like vargetype. But one thing missing is function stack info. Heck you can’t even tell what function you’re in at the top level. Yes. But I argue it’s trivial to implement as a simple file preprocesser which essentially prepends a unique token on file local variables thru out the file. It’s self contained. But namespaces is even better. Don’t think it does, but I DIM too.1 point -
(Poll) What features do you wish you had in AutoIt?
JockoDundee reacted to TheDcoder for a topic
Looks like I have a lot to respond to 😅 I understand advantages of machine code, but can you elaborate on why you think byte code wouldn't make sense? It allows the interpreter to function without parsing the same old code on every execution, aside from the obvious benefit of cutting down on the code required for the parser itself. Byte code would also serve as a good intermediate between pure machine instructions and pure script interpretation, perhaps it can later be used by different compilers which could target different instruction sets This is important in our "smart" "IoT" connected world, where many small devices use ARM or some other instruction-based processor, x86 is very rare outside of personal computers I think. -- About memory management, I am not sure I entirely understand what you mean, do you want to be able to set a hard limit on the amount of memory the process can use? Boost: I looked at it and it is indeed a very good library, but an awful lot of it seems to be very specific to C++, in fact one of their goals is to get these functions integrated into standards... and integrating with it means also following same mindset as C++, which is something I really want to avoid at all costs, I'd say it would be an anti-goal. A large part of the library deals with C++ language features, only a few actually provide useful "end-user features" like dates, filesystem, http etc. So even if we wanted to integrate with boost ignoring the other stuff, the benefit isn't that much... and there are better libraries which can provide support for these kind of things anyway. Even in C++ there is Qt which provides everything a desktop programmer could ever want, and there is already a BASIC language which integrates with it @JockoDundee For sure! This is one of the features I had planned from the start, you will be able to use assignment in expressions I might also add an additional operator, something like python's := to make it more explicit. File scope as in variables which are not shared across includes? This suggestion sounds good on the surface but it has several issues, #include is treated as a "copy-and-paste" inside the scanner/tokenizer, so it is completely transparent to the syntax analyzer (the actual parser). We could make the parser more complex by adding the ability to recognize the file boundaries and then implement file scope that way but I am not sure if that is a wise design decision. A more appropriate feature might be namespaces, which you have mentioned in your latest post Objects is an ambigious term, it can be a misnomer, one of the meanings is just a term for any value... but I guess you are talking about them in the context of "Object-oriented programming", I might implement an "object" in the form of a structure (simply a variable which contains a fixed number of elements which can be referred by names, very similar to maps/associate arrays). Reflections if I am recalling correctly are traps for operations on a variable/object, it is an interesting prospect for sure Good one, noted! Another one of the things I had in my mind from the start, I think I made a topic here in the forums requesting the feature. Rest assured this will make its into ECI I am trying to keep whitespace as less significant as possible, some might be opposed to the idea but I would prefer flexibility as it offers a chance to write code in a less awkward way in certain situations while maintaining the usual norms in normal circumstances. Doesn't AutoIt already have this feature? It's simple enough to DIY too: Func Bool($vVar) Return Not Not $vVar EndFunc But yeah, casts are useful. How would this be different than returning an array? In my opinion this is one of the most important features of a high-level scripting language, having the ability to use it everywhere. Not saying that it would be a "Code-once run everywhere" thing, but the fundamentals would stay same and the programmer can handle platform specific stuff with their code. AutoIt is definitely not meant for OOP, some may not agree but I think in spirit it wouldn't be AutoIt if we add OOP to it. Objects are okay, but not a full-fledged inheritance system Sounds like an array, python calls them lists. I think you might be referring to something more than an array, so can you elaborate? GUI is another beast, and of course a visual designer is a hard thing to make. I am not in an hurry to implement this. Eventually I will implement GUI with support for layout-based design, similar to how HTML and GTK work, as opposed to absolute pixel position based design (this would still be possible if needed) Sorry, if we did this it won't be AutoIt Does any BASIC dialect support this feature actually? -- Wow, this might be my longest reply post.1 point -
(Poll) What features do you wish you had in AutoIt?
TheDcoder reacted to JockoDundee for a topic
Thx. What about file scope for variables, did that come up often? With the heavy reliance on UDFs by AutoIt, which necessitate the namespace sharing of globals between unrelated modules, I would think it would. Also, I naively imagine such a change to be backward compatible, and relatively straightforward to implement, by just prepending some unique magic string (based on the file name) to the file local declaration and references within each file. What could go wrong?1 point -
create a Word Frequency Counter
TheDcoder reacted to JLogan3o13 for a topic
@vinnyMS This forum is dedicated to people who want to learn/improve at AutoIt scripting; it is not a place where you put in an order and someone just barfs up the code for you. If we did that, you'd never understand when you ran into a problem, or attempted to update the code Take a look at the sections I suggested in the help file. Each has great examples that you can try out on your own. Once you have done so, if you're running into issues, post what you have tried and we will gladly steer you in the right direction.1 point -
Is this correct...? First time using this Application.
SkysLastChance reacted to Subz for a topic
The issue you will probably encounter is UAC, so it will prompt for credentials before actually running the script. The best way is to use a third party tool to install the software remotely for example: PDQ Deploy - Free version available, (we use the full version for third-party updates, i.e. Adobe products, Chrome etc.. PDQ release these on a monthly basis). Lansweeper - Free version allows up to 100 assets to be managed (we use this mostly for hardware/software inventory but it does allow remote software installations. PSExec - Allows you to execute software remotely with administrative privileges. My 2 cents.1 point -
Does this cast conversion make logical sense?
TheDcoder reacted to JockoDundee for a topic
@Melba23, Local $a = "abc" ; Not True as $a converts to 0 If $a = 1 Then ConsoleWrite("$a=1" & @CRLF) ; Not true as $a converts to True, Not $a toggles to False, and 1 is converted to boolean True If (Not $a) = 1 Then ConsoleWrite("(Not $a) = 1" & @CRLF) ; True as ($a = 1) is False (see above), and Not then toggles it to True If Not ($a = 1) Then ConsoleWrite("Not ($a = 1)" & @CRLF) ; I leave these as exercises for the student - as my old maths master used to say ; Funny thats what my old gym teacher used to say ; True as (Not $a) is False, Not toggles to True, and 1 is converted to boolean True If Not (Not $a) = 1 Then ConsoleWrite("Not (Not $a) = 1" & @CRLF) ; Not True as ($a = 1) is False and Not toggles True and Not toggles False If Not (Not ($a = 1)) Then ConsoleWrite("Not (Not ($a = 1))" & @CRLF) btw, and afaik, unlike some other basic Is<data type> functions, IsNumber(), IsString(), IsInt(), IsPtr(), with IsBool() there is no complimentary cast function to Boolean, e.g. Bool(). This may be by design because of limited use, or perhaps some other reason. In any case, if at any time a decision is made to add such a function to the canon, please consider the following implementation: Func Bool($vExpression) Return Not Not $vExpression EndFunc (Please no “Not Not” Jokes from the peanut gallery1 point -
JockoDundee, The vital part of the "Operators" page in the Help file is further down than VIP's quote above: So your statement that both empty AND non-empty strings are converted to 0 is quite true - and why it is very inadvisable to mix datatyes in comparisons. M231 point
-
extract a sentence containing word in text file
TheDcoder reacted to JockoDundee for a topic
Predict whether the OP will succumb to my thinly veiled up-voting extortion scheme... On the one hand, he seems to really need the program, On the other hand, he doesn't respond well to direction.1 point -
Never underestimate a MVP that speak french at 6h30 pm...1 point
-
I would have truly appreciated you as a teacher in those days...1 point
-
extract a sentence containing word in text file
TheDcoder reacted to JockoDundee for a topic
Local $sentences=".!? " & StringRegExpReplace(FileRead("2.txt"), "([\!\.\?])", "$1.!?") FileDelete("results.txt") For $word In StringSplit(FileRead("1.txt"), @CRLF, 3) FileWriteLine("results.txt",@CRLF & "WORD: "& $word) $iEPos=1 For $n = 1 to 3 $iWPos=StringInStr($sentences, $word, 0, 1, $iEpos) If $iWPos=0 Then ExitLoop $iSPos=StringInStr($sentences, ".!?", 0, -1, $iwPos) $iEPos=StringInStr($sentences, ".!?", 0, 1, $iwPos) $sentence=StringStripWS(StringMid($sentences, $iSPos + 3, $iEPos - $iSpos - 3),3) FileWriteLine("results.txt", $sentence) Next Next IMHO, you deserve an A+.1 point -
(The title of this example was originally "The Shell/Custom Favorites/Programs Menus".) This is an implementation of the Shell Favorites and Programs menus with the IShellMenu interface. The purpose of this menu system is to create a popup menu from a directory structure consisting of subfolders and internet or program links. The menu will look like the Favorites menu in Internet or Windows Explorer (as it looked when XP SP2 was released in August 2004). The IShellMenu interface can generally be used to create a menu from a directory structure. The menu items will be supplied with the same icons as the link files and they will be supplied with tooltips too. When you click a menu item the command associated with the internet or program link will be executed. The Favorites and Programs menus will create popup menus from the directory structures given by $CSIDL_FAVORITES, $CSIDL_PROGRAMS, $CSIDL_STARTMENU, $CSIDL_COMMON_PROGRAMS, $CSIDL_COMMON_STARTMENU. The Custom Favorites and Custom Programs menus can be used to create custom popup menus from custom directory structures. Note that the context (right click) menu is working in the Favorites menu. Update #4 2014-05-03: AutoIt 3.3.10 This example was created under 3.3.8 and based on APIConstants.au3 and WinAPIEx.au3 by Yashied. The original example runs under 3.3.10 without any changes at all. But a lot of unused constants and functions are included. In 3.3.10 the two UDFs are divided into several smaller UDFs. This makes it much easier to just include, what is needed. This update only includes the necessary UDFs. You find the new and old zip in bottom of the post. Update #3 2012-11-06: Programs menus Added the Programs menus from the directory structures given by $CSIDL_PROGRAMS, $CSIDL_STARTMENU, $CSIDL_COMMON_PROGRAMS, $CSIDL_COMMON_STARTMENU. To create a menu like the "All Programs" menu copy the two "Start Menu" folders (your own + "All Users") to the "Custom Programs 1" folder and overwrite the existing "Start Menu" folder. Then select the menu item "Custom Programs | Custom Programs 1". Update #2 2012-11-03: Custom Favorites menus If you are creating an AutoIt program and want to add a custom Favorites menu with relevant internet links all you have to do is to create a directory structure, add the subfolders (optional) and links and call the ShowFavsProgsMenu() function with a path to the directory. And you will get a menu that looks like and works like the Favorites menu in Internet Explorer. You can see two custom Favorites menus in the examples. Added two small directory structures to the zip to be used for the custom Favorites menus. Fixed an error: OleInitialize() is used to initialize COM in stead of CoInitialize() (necessary to make the Copy command in the context menu work). Update #1 2012-11-01: Window procedure Because a popup menu like the Favorites menu is modal, it's necessary to use some kind of a window procedure to catch the menu messages. When it's a popup menu it should be enough to have the window procedure running while the popup menu is displayed. In the original scripts the window procedure was created with these commands: $hNewWinProc = DllCallbackRegister( "NewWindowProc", "int", "hwnd;uint;wparam;lparam" ) ; New window procedure $hOldWinProc = _WinAPI_SetWindowLong( $hGui, $GWL_WNDPROC, DllCallbackGetPtr( $hNewWinProc ) ) ; Old window procedureThe procedure was started in the main script in the example and was running as long as the script was running. In this update the menu messages is catched with a hook procedure: $hFavMenuMsg = DllCallbackRegister( "FavMenuMsg", "long", "int;wparam;lparam" ) $hFavMenuMsgHook = _WinAPI_SetWindowsHookEx( $WH_MSGFILTER, DllCallbackGetPtr( $hFavMenuMsg ), 0, _WinAPI_GetCurrentThreadId() ) ; $WH_MSGFILTER installs a hook procedure that monitors messages generated as a ; result of an input event in a dialog box, message box, menu, or scroll bar.The procedure is started in the bottom of the ShowFavoritesMenu() function immediately after the Favorites menu is displayed on the screen, and the procedure is stopped when the menu disappears from the screen. Either because the menu is cancelled or a selection is made. (If you comment out these commands in ShellFavoritesMenu.au3 the Favorites menu will still show up. But the submenus will not be expanded if you keep the mouse steady over a submenu or use the arrow keys.) This hook procedure is much better than the original window procedure. It's much easier to integrate the Favorites menu in other programs when it isn't depending on a "global" window procedure. A "global" window procedure can also have some influence on the GUI (at least on XP, I think it's better on 7). In the original example you saw it clearly when the GUI lost focus. When the GUI got focus back the upper line of the edit box could be behind the toolbar. This is not a problem with a hook procedure only running when the Favorites menu is displayed. Added an example with a menu. Zip updated. First post 2012-10-30 This is an implementation of the Favorites menu primary with the IShellMenu interface but several other interfaces are used as well. The main function: Func ShowFavoritesMenu( $hWnd, $hMenu, $xCoord, $yCoord ) ; --- Create a menu band object and the IShellMenu interface --- Local $oIShellMenu, $pIShellMenu ; Create a menu band object and get a pointer to the IShellMenu interface CoCreateInstance( $tCLSID_MenuBand, $NULL, $CLSCTX_INPROC_SERVER, $tRIID_IShellMenu, $pIShellMenu ) $oIShellMenu = ObjCreateInterface( $pIShellMenu, $sIID_IShellMenu, $dtag_IShellMenu ) If Not IsObj( $oIShellMenu ) Then Return SetError(1,0,0) ; --- Initialize the interface --- If $oIShellMenu.Initialize( $NULL, -1, $ANCESTORDEFAULT, BitOR( $SMINIT_TOPLEVEL, $SMINIT_VERTICAL ) ) <> $S_OK Then Return SetError(2,0,0) ; --- Specify the folder for the menu band to browse --- ; Get a pointer to the IShellFolder interface for the desktop Local $pIShellFolder = $NULL, $oIShellFolderDesktop, $pIShellFolderDesktop, $pidlRel SHGetDesktopFolder( $pIShellFolderDesktop ) SHGetSpecialFolderLocation( $NULL, $CSIDL_FAVORITES, $pidlRel ) $oIShellFolderDesktop = ObjCreateInterface( $pIShellFolderDesktop, $sIID_IShellFolder, $dtag_IShellFolder ) $oIShellFolderDesktop.BindToObject( $pidlRel, $NULL, $tRIID_IShellFolder, $pIShellFolder ) If $pIShellFolder = $NULL Then Return SetError(3,0,0) ; Get the registry key with the "Order" value of the Favorites folder Local $hRegOrder = _WinAPI_RegOpenKey( $HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Favorites", $KEY_READ ) If $hRegOrder = 0 Then Return SetError(4,0,0) ; Specify the folder for the menu band to browse If $oIShellMenu.SetShellFolder( $pIShellFolder, $pidlRel, $hRegOrder, BitOR( $SMSET_BOTTOM, $SMSET_USEBKICONEXTRACTION ) ) <> $S_OK Then Return SetError(5,0,0) _WinAPI_CoTaskMemFree( $pidlRel ) _WinAPI_RegCloseKey( $hRegOrder ) ; --- Append a static menu to the menu band --- If $oIShellMenu.SetMenu( $hMenu, $hWnd, $SMSET_TOP ) <> $S_OK Then Return SetError(6,0,0) ; --- Get access to IMenuPopup, IDeskBar and IDeskBand interfaces --- Local $pIMenuPopup, $pIDeskBar, $pIDeskBand ; The IMenuPopup interface If $pIShellMenu Then If $oIShellMenu.QueryInterface( $tRIID_IMenuPopup, $pIMenuPopup ) <> $S_OK Then Return SetError(7,0,0) EndIf ; The IDeskBar interface If $pIMenuPopup Then Local $oIMenuPopup = ObjCreateInterface( $pIMenuPopup, $sIID_IMenuPopup, $dtag_IMenuPopup ) If $oIMenuPopup.QueryInterface( $tRIID_IDeskBar, $pIDeskBar ) <> $S_OK Then Return SetError(8,0,0) EndIf ; The IDeskBand interface If $pIDeskBar Then Local $oIDeskBar = ObjCreateInterface( $pIDeskBar, $sIID_IDeskBar, $dtag_IDeskBar ) If $oIDeskBar.QueryInterface( $tRIID_IDeskBand, $pIDeskBand ) <> $S_OK Then Return SetError(9,0,0) EndIf ; --- Create a menu desk bar object and the IMenuPopup interface --- Local $oIUnknown, $pIUnknown, $oIMenuPopup, $pIMenuPopup ; Create a menu desk bar object and get a pointer to the IUnknown interface CoCreateInstance( $tCLSID_MenuDeskBar, $NULL, $CLSCTX_INPROC_SERVER, $tRIID_IUnknown, $pIUnknown ) $oIUnknown = ObjCreateInterface( $pIUnknown, $sIID_IUnknown, $dtag_IUnknown ) ; Create the IMenuPopup interface $oIUnknown.QueryInterface( $tRIID_IMenuPopup, $pIMenuPopup ) $oIMenuPopup = ObjCreateInterface( $pIMenuPopup, $sIID_IMenuPopup, $dtag_IMenuPopup ) If Not IsObj( $oIMenuPopup ) Then Return SetError(10,0,0) ; --- Create a menu band site object and the IBandSite interface --- Local $oIBandSite, $pIBandSite ; Create a menu band site object and get a pointer to the IBandSite interface CoCreateInstance( $tCLSID_MenuBandSite, $NULL, $CLSCTX_INPROC_SERVER, $tRIID_IBandSite, $pIBandSite ) $oIBandSite = ObjCreateInterface( $pIBandSite, $sIID_IBandSite, $dtag_IBandSite ) If Not IsObj( $oIBandSite ) Then Return SetError(11,0,0) ; --- Set the band site object as client for the desk bar object --- If $oIMenuPopup.SetClient( $pIBandSite ) <> $S_OK Then Return SetError(12,0,0) ; --- Add the desk band object to the band site object --- If $oIBandSite.AddBand( $pIDeskBand ) <> $S_OK Then Return SetError(13,0,0) ; --- Show the Favorites menu --- Local $tPOINT = DllStructCreate( $tagPOINT ) DllStructSetData( $tPOINT, "X", $xCoord ) DllStructSetData( $tPOINT, "Y", $yCoord ) Local $tRECT = DllStructCreate( $tagRECT ) DllStructSetData( $tRECT, "Left", $xCoord ) DllStructSetData( $tRECT, "Top", $yCoord+1 ) DllStructSetData( $tRECT, "Right", $xCoord ) DllStructSetData( $tRECT, "Bottom", $yCoord+1 ) $oIMenuPopup.Popup( $tPOINT, $tRECT, $MPPF_ALIGN_RIGHT ) ; --- Create the IMenuBand interface --- Local $oIDeskBand $oIDeskBand = ObjCreateInterface( $pIDeskBand, $sIID_IDeskBand, $dtag_IDeskBand ) $oIDeskBand.QueryInterface( $tRIID_IMenuBand, $pIMenuBand ) $oIMenuBand = ObjCreateInterface( $pIMenuBand, $sIID_IMenuBand, $dtag_IMenuBand ) If Not IsObj( $oIMenuBand ) Then Return SetError(14,0,0) ; $oIMenuBand and $pIMenuBand are global variables ; $oIMenuBand is used to handle the messages from the Favorites menu in the function below ; $pIMenuBand is used to test if the Favorites menu is open ($pIMenuBand <> $NULL) Return 0 EndFunc Example The zip contains the example as you can see in the picture. There are two versions of the example: A version based on a toolbar (ExShellFavsProgsMenus.au3), and a version based on a menu bar (ExShellFavsProgsMenus2.au3). The purpose of the text box is just to have something to put in the window. The zip contains also the ShellFavsProgsMenus.au3 UDF. This zip contains the original scripts for 3.3.8. You need APIConstants.au3 and WinAPIEx.au3 by Yashied. The UDFs are not included in the zip. The zip can be opened with 7-Zip. ShellFavsProgsMenus.zip This zip contains the updated scripts for 3.3.10. Only a matter of UDFs. These scripts will not run under 3.3.8. TheFavoritesMenu.7z Testet on XP 32 bit and Win 7 32/64 bit.1 point
-
I don't see the relationship with C, but wait I can answer. Long ago I coded a function able to sort a given array of any dimension (up to the maximum of 24) using a user-provided function. The user knows the array structure and will have no problem providing a function for comparing two rows and deciding which is greater. It can be a complex compare of a complex filed or a non-trivial multi-column sort. To do this in plain C you use a function named qsort which does the job very efficiently (using introsort, heapsort and insertion sort). To do the same in AutoIt you'll have to build a 1D array of indices for storing the initial indices of the unsorted array, invoke the compare function and change the 1D array in new indices being sorted. When the sort is complete, copy the unsorted elements in sorted order. Unfortunately (or fortunately) we don't have pointers in AutoIt so we have to copy array rows element by element, dimension by dimension. Also since we can have to handle arrays of any dimension, we can't build a text statement and execute it, so we have to code things like that: Switch UBound($aStruct) Case 1 Redim $aRet[$aStruct[0]] Case 2 Redim $aRet[$aStruct[0]][$aStruct[1]] Case 3 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]] Case 4 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]] Case 5 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]] Case 6 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]] Case 7 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]] Case 8 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]] Case 9 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]] Case 10 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]] Case 11 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]] Case 12 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]] Case 13 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]] Case 14 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]] Case 15 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]][$aStruct[14]] Case 16 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]][$aStruct[14]][$aStruct[15]] Case 17 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]][$aStruct[14]][$aStruct[15]][$aStruct[16]] Case 18 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]][$aStruct[14]][$aStruct[15]][$aStruct[16]][$aStruct[17]] Case 19 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]][$aStruct[14]][$aStruct[15]][$aStruct[16]][$aStruct[17]][$aStruct[18]] Case 20 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]][$aStruct[14]][$aStruct[15]][$aStruct[16]][$aStruct[17]][$aStruct[18]][$aStruct[19]] Case 21 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]][$aStruct[14]][$aStruct[15]][$aStruct[16]][$aStruct[17]][$aStruct[18]][$aStruct[19]][$aStruct[20]] Case 22 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]][$aStruct[14]][$aStruct[15]][$aStruct[16]][$aStruct[17]][$aStruct[18]][$aStruct[19]][$aStruct[20]][$aStruct[21]] Case 23 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]][$aStruct[14]][$aStruct[15]][$aStruct[16]][$aStruct[17]][$aStruct[18]][$aStruct[19]][$aStruct[20]][$aStruct[21]][$aStruct[22]] Case 24 Redim $aRet[$aStruct[0]][$aStruct[1]][$aStruct[2]][$aStruct[3]][$aStruct[4]][$aStruct[5]][$aStruct[6]][$aStruct[7]][$aStruct[8]][$aStruct[9]][$aStruct[10]][$aStruct[11]][$aStruct[12]][$aStruct[13]][$aStruct[14]][$aStruct[15]][$aStruct[16]][$aStruct[17]][$aStruct[18]][$aStruct[19]][$aStruct[20]][$aStruct[21]][$aStruct[22]][$aStruct[23]] Case Else Return SetError(1, 0, 0) EndSwitch or worse: ; copy entries of $aTmp to $aArray in order of $oIndices ; AutoIt being unable to address/access subarrays and Execute row-wise assignments makes the code ridiculously painful and slow Switch $iDims Case 1 For $a = $iStart To $iEnd If $__aIndices[$a] <> $a Then $aArray[$a] = $aTmp[$__aIndices[$a]] Next Case 2 For $a = $iStart To $iEnd If $__aIndices[$a] <> $a Then For $b = 0 To $aUBounds[1] $aArray[$a][$b] = $aTmp[$__aIndices[$a]][$b] Next EndIf Next Case 3 For $a = $iStart To $iEnd If $__aIndices[$a] <> $a Then For $b = 0 To $aUBounds[1] For $c = 0 To $aUBounds[2] $aArray[$a][$b][$c] = $aTmp[$__aIndices[$a]][$b][$c] Next Next EndIf Next Case 4 For $a = $iStart To $iEnd If $__aIndices[$a] <> $a Then For $b = 0 To $aUBounds[1] For $c = 0 To $aUBounds[2] For $d = 0 To $aUBounds[3] $aArray[$a][$b][$c][$d] = $aTmp[$__aIndices[$a]][$b][$c][$d] Next Next Next EndIf Next Case 5 For $a = $iStart To $iEnd If .Item($a) <> $a Then For $b = 0 To $aUBounds[1] For $c = 0 To $aUBounds[2] For $d = 0 To $aUBounds[3] For $e = 0 To $aUBounds[4] $aArray[$a][$b][$c][$d][$e] = $aTmp[.Item($a)][$b][$c][$d][$e] Next Next Next Next EndIf Next ......... up to dimension 24 This is ridiculous. Points 2, 3 & 6 in my previous post would make that possible and valuable, else things are too slow to be of real use. See how difficult it is to sort a simple 2D array on several columns or with a custom compare function. Every case needs a specially tailored function!0 points