Latest Version : 6.00 (Build 2008:0730:1530)
Warning! Version 6.00 is NOT compatible with previous versions!
Download (v6.00) @ Location 1 : AHKA AHK File
Download (v5.42) @ Location 1 : AHKArray AHK File
Download (v5.41) @ Location 1 : AHKArray AHK File
Download (v5.39) @ Location 1 : AHKArray AHK File
Download (v5.38) @ Location 1 : AHKArray AHK File
Download (v5.37) @ Location 1 : AHKArray AHK File
Download (v5.23) @ Location 1 : AHKArray AHK File
Bug Reports & License
Please send all bug reports, comments, suggestions, etc to <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->, or post them as replies to this forum topic.
PS. Feel free to edit/use code as you like, the license just says that you're allowed to do anything you like, as long as the license stays there, and my name doesn't get used for advertising (yeah right XD).
Description
AHKA stands for AutoHotkey Array (or AHKArray).
AHKArray provides a way to store multiple variables, as one. It eliminates the necessity for using global variable arrays that are generated by functions such a stringsplit.
This means arrays can now be stored in ONE varaible, and returned by a function. No more array variable clutter.
AHKArray supports an "infinite" amount of dimensions. (Well, as much as your memory can take without blowing up.)
Starting with v5.35, contents of Array are HEXed, enabling the use of ANY of the first 256 ASCII characters inside of them.
This library is rather heavy and feature filled. If you want a smaller, faster single variable array library, please refer to infogulch's SimpleArray. You can also take a look at a singly linked list concept showcase here.
Specifics
~ Syntax : For Non-HEXed AHKArray is similar to ActionScript
Array := "[a,b,[A,B],c]"~ Syntax : For HEXed AHKArray is similar to a HEXed ActionScript
Array := "[61,62,[97,98],63]" Array := AHKA_NewArray("[a,b,[A,B],c]")
~ Compatability : Conversion from standard Array%i% arrays, is inbuilt
~ Advanced Indexes :
Index=0 : (DEFAULT) Add/Get/Remove/Set/Etc the LAST index in the array
AHKA_Add("[1,2,3]",BLAH) ;returns "[1,2,3,BLAH]" ;same as AHKA_Add("[1,2,3]",BLAH,0)Index>0 : Add/Get/Remove/Set/Etc the INDEX index in the array
AHKA_Add("[1,2,3]",BLAH,2) ;returns "[1,BLAH,2,3]"Index<0 : Skip INDEX indexes from back and then Add/Get/Remove/Set/Etc the next index
AHKA_Add("[1,2,3]",BLAH,-1) ;returns "[1,2,BLAH,3]"~ Usage : Simply put the "AHKA.ahk" file into your "AutoHotkey/Lib/" directory, OR include it at the end of your program via "#Include AHKA.ahk".
~ HEX : The data stored can now be HEXed automatically
~ Chaining : All functions are chainable :
Array := AHKA_Remove(AHKA_Set(AHKA_Add(AHKA_Add(AHKA_Add(AHKA_NewArray(),"A"),"B"),"C"),"B+",2),1) ; [] -> [A] -> [A,B] -> [A,B,C] -> [A,B+,C] -> [B+,C]~ Free-Style Decalaration (Automatic HEXing) :
myArray := AHKA_NewArray("[1,2,[31,32],4]")Don't see a feature you want? Post it here, and I'll try to add it.
Reserved Strings for Non-HEXing
Inside AHKArray, you may not store strings containing the following symbols ONLY IF you are NOT using HEXing:
[ ] | ,Note: Contents are automatically HEXed. This can be changed by calling AHKA_SetDebug(true) to disable HEXing, and AHKA_SetDebug(false) to enable HEXing.
Version History
Version 0
First release
Basic functions work
Dimensions work up to 2D (in most cases)
Version 1 - 3
Fixed a bug with adding to an empty array.
Added Insert function
Added a "Documentation"
Added a Convert function (now, all the functions that generate Array%i% kind of arrays, can also be used with AHKAArray (the generated variable Array%i% must be global!)
Changed array format
It is now possible to say this:Array = "{1,2,3,4}"To declare an array
Fixed an error with Get()
Version 4
Completely rewrote scripts (thus fixing lots of bugs)
All basic functions work (as tested) for as many dimensions as needed
Array Syntax changed to Flash-StyleArray = "[1,2,[31,32,[331,332],34],4,5]"Added Split() function
Version 5
Initial:
Completely rewrote scripts from scratch ... again
All functions work (as tested) for as many dimensions as needed
Sample code included
Array dimensionality is now supported by Parse/Unparse functions (wrongly named so =P)
Patched:
Added Sort() function
Added Swap() function
Added Minimum() function
Added Maximum() function
Added Find() function
Added Reverse() function
Added Merge() function
Added Trim() function
Added Mathematical Floor(),Abs() functions
Upgraded Get() function
Added String() function
Added HEX support
Get() and Set() functions Overloaded
Set() function speed improved
Fixed Remove() function for arrays
Version 6
Overloaded every major function.
Added freestyle array declaration to NewArray.
Changed to Library format, #include not necessary anymore.
Optimized various functions.
Added "debug mode" (dynamic non-HEXing mode).
Made a new Documentation.
Created (still creating) complete AHKA tester (with GUI), usable as sample code.
Documentation
Documentation & Tutorials for AHKA are availiable here.
Note: Utility functions are not yet documented, but are also not meant to be used on their own (only by other functions), so no functionality is lost.
Note: Tutorials are still under construction, sorry.