Before I begin, I would like to send a BIG, BIG thanks to Lexikos for the template which spawned into this Class library.
The Class library is a toolset to add OOP (Object-Oriented Programming) to AHK:
For a full list of changes, see Version History.
Ask for help on how to use the class library in the Class Library (OOP) - Help thread.
Please post requests for additional functionality and any bugs you may find (on the site or in the code) at the Class library (OOP) - Wish list / Bug reports thread. Of course, if you wrote functionality that you wish to be included, please share it so that others can enjoy your additions as well.
Additionally, if you wrote any Classes that you would like me to link to,
please PM
me.
In the message, please include:
This can be a homepage, your AHK profile, or whatever (within reason). If you don't specify a link, I will still give you credit for your work.
Maintaining the class library requires a lot of time and effort. If you find the class library useful, please consider donating.
Don't feel like you have to donate a lot. I'd rather have two people donate $5, than 100 feel they can't justify $20.
Note: I will never require payment to use the Class library, nor will I put a donate link in AccessClassLibrary. I have no desire to impede the program's functionality by including a donate link.
Class.zip contains the following:
To easily navigate the site, download AccessClassLibrary.zip. See the AccessClassLibrary post for more details.
Extract the contents of the zip into a library folder.
Check out the included example scripts (located in the "Class examples" folder) for an overview on how to use Classes.
Add: An introduction to OOP - explains traditional OOP and shows how to adapt it to AHK OOP
Add: Interfaces. There is an example interface Coin, and an example of it Coin_test (located in the "Class examples" folder).
Add: The List interface - Array and Vector both implement the List interface.
Add: The Class_setConstants function - Get / set multiple constants at a time
Add: Constructors Array_new1 and Vector_new1. Each take a single parameter, a List object, and creates a new Array / Vector from the existing List.
Mod: The Node_new function has been refactored to facilitate making classes with multiple constructors.
Mod: AccessClassLibrary has been updated with the new list of functions. Also, I incorporated a sligtly modified version of Intellitype. Every function and "webpage anchor" (webpage + stuff after the "#") is loaded via the included ClassLibraryFunctions.txt. A tooltip will appear if the inputted page contains a "_" or a "#" and shows all matching pages. Make a selection by typing twice (in quick selection). For example typing "1" twice will make the first selection.
Mod: modified Class_getValue and Class_setValue so that the value of ErrorLevel is preserved. Both functions make calls that modify ErrorLevel is undesired ways. This means that if a function were to set ErrorLevel, and called either function afterwards (e.g. to return a field), then ErrorLevel would be modified unintentially.
Fix: Shallow clones now correctly work. To perform a shallow clone, specify False (0), or the empty string for the deep copy parameter in a class' clone function (the Class must be cloneable). A shallow copy is identical to a deep copy, except that obj types are copied (not cloned) - the lock count will be increased by one to reflect being stored in an additional location.
Fix: When setting an robj type (e.g. via the Array_replace and Vector_replace), if the new object was identical (same address) as the old value, the function would (incorrectly) return false (0). It now correctly returns the previous object.
Fix: Deep clones now correctly work. Before, when an obj type was cloned, its lock count wasn't increased. The lock count is now increased by one to reflect the object being stored in another location.
Add: Class_in: combines the functionality of if var in/contains MatchList and a Parsing Loop.
This update is in response to this thread - "if Var in MatchList" is very slooooow.
Mod: The Node Class has been updated to use the Class_in function (in the Node_constant function)
Official release of the Class library.