"Post-Include" command.

Propose new features and changes
User avatar
Delta Pythagorean
Posts: 413
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Equestria

"Post-Include" command.

14 Dec 2017, 08:19

I don't really know what I'm thinking, I just feel that AHK should have some sort of command/function to "post-include" a script into a compiled script.
So, similar to FileInstall, it would load the file, if said file is in the directory specified, the compiled script then loads it and uses it, but it'd only load into the script upon starting, not conditional. However, I think that, if the file could not load in the file (Whether file format is different such as Unicode vs ASCII, or the file isn't in the AHK syntax language) it would return ErrorLevel where the script could work off of it and do something, or display a message, etc etc.

The way I think it should work as to not throw a bunch of errors would be:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



It's just something that I would think would be quite useful, esspecially for plugins or just allowing users to customize certain variables without having to include a library to read from a certain type of file like XML or JSON, or having to use IniRead which already is a little "wonky" when it comes to loading in UTF-8 files.

If you have any suggestions on this, comments, or even criticisms, please do reply! :D
User avatar
jeeswg
Posts: 4280
Joined: 19 Dec 2016, 01:58
Location: UK

Re: "Post-Include" command.

17 Dec 2017, 12:35

If you're talking about #Include, to include the script at the bottom of the script rather than at the point where #Include is written, there is one thing of interest here:

Functions
https://autohotkey.com/docs/Functions.htm#lib
A script may call a function in an external file without having to use #Include. For this to work, a file of the same name as the function must exist in one of the following library directories:

An example to illustrate the idea:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Re. UTF-8 and ini:
UTF-8 ini files - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=38511

Here I mention a proposal for this, called #IncludeAtEnd:
Wish List 2.0 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=13&t=36789

You said quite a few things in your post, so it might be helpful to break it down a bit, explain further what you had in mind. Cheers.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 4 guests