commands as functions (AHK v2 functions for AHK v1)

Discuss the future of the AutoHotkey language
User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

commands as functions (AHK v2 functions for AHK v1)

26 Mar 2017, 17:19

[Latest version:]
commands as functions (AHK v2 functions for AHK v1) - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=37&t=29689&p=197355#p197355

[Changelog:]

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


==================================================

At the time of writing (March 2017), AHK v2 alpha introduces 139+50=189 new functions.
- 139 are function versions of AHK v1 commands (with the same name as existing AHK v1 commands).
- 50 are variants of AHK v1 commands (with names different from any existing AHK v1 commands) or are functions that introduce new functionality.

List of functions (needed for the library):

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



List of commands/functions being removed (57+7=64) (for reference):


The aim of this project is to make those functions available to AHK v1.

==================================================

I recently found out that Coco has been working on a similar project.
- I would say that his code is 98% the same as mine, plus he has some nice RegEx for the 'InputBox' function, and has recreated the 'Type' function, which is the one function I was yet to write.
- So reluctantly I think it would be better to support his effort, rather than cause massive confusion, with two independent sets of almost identical code.

Example functions:

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



GitHub - cocobelgica/AutoHotkey-Future: Port of AutoHotkey v2.0-a built-in functions for AHK v1.1+
https://github.com/cocobelgica/AutoHotkey-Future

The last work there was done in March 2016, MsgBox/InputBox/TrayTip for example, may need to be updated.

Useful comments regarding the functions (and potential issues/problems) are available here:
Default/Portable installation StdLib - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=13&t=10434
AutoHotkey-Future/Lib at master · cocobelgica/AutoHotkey-Future · GitHub
https://github.com/cocobelgica/AutoHotkey-Future/tree/master/Lib

The code from Mar 2016 has:
- 136 'AHK v1' functions (missing Edit/FileAppend/PostMessage/SendMessage) (EnvUpdate is there but shouldn't be).
- 49 'AHK v2' functions (missing RegDeleteKey).

Some code I wrote in Coco's style for the missing functions:

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



Code to combine the individual function ahk files, into one file:

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



==================================================

A beta demonstration of what an 'AHK v2 functions for AHK v1' library might look like, based on Coco's code.

Note: FileInstall cannot be completely recreated as a function. [EDIT:][Actually, the post below mentions some workarounds.]
Note: The Gui command would make any script that uses such a library #Persistent, so I would advise commenting out that function. [EDIT:][You could have just the Gui function in a separate file if you wanted it some times but not other times.]

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



[EDIT:]
Amended versions of functions, *not* changed in the full list of functions above:
FileSetAttrib, FileSetTime, SoundPlay, StrLower, StrUpper, WinSetEnabled
[still require amending: MsgBox, TrayTip]

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

Last edited by jeeswg on 28 Jan 2018, 23:34, edited 17 times in total.
lexikos
Posts: 5686
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: commands as functions (AHK v2 functions for AHK v1)

26 Mar 2017, 20:58

See Default/Portable installation StdLib in Wish List.
Note: FileInstall cannot be completely recreated as a function.
It can. You can retrieve the data with FindResource/LoadResource/LockResource.

HotKeyIt's version of the compiler handles the function syntax, although the compiler itself might require AutoHotkey_H v2. I haven't tested it.
Note: The Gui command would make any script that uses such a library #Persistent, so I would advise commenting out that function.
There is no need to comment it out if it is in its own file, as it is in Coco's project. The file structure in Coco's project allows the functions to be auto-included from the function library (and only those functions which are called).

Of course, the presence of Gui() will still cause the script to be persistent.

Anyway, the Gui() function is very unlikely to be retained in v2. See this topic.
User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

Re: commands as functions (AHK v2 functions for AHK v1)

27 Mar 2017, 16:50

I just compared the syntax text from the current AHK v1 help htms v. the AHK v2 htms, in WinMerge.

[script to get syntax text from AutoHotkey.chm (decompiled) htms, or htms from GitHub:]
list of every command/function/variable from across all versions - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=27321&p=130479#p130479

Btw, wow, hundreds of files in the Lib folder, one for each function, that would be mayhem, I thought that was just temporary, for diagnostic purposes. I currently have 44 scripts in my library, 22 by others, 22 by me.

I'm not sure if this addition to the Hotkey command will cause an issue:
Hotkey, If, % FunctionObject

Comparing the texts, I noticed that the Label parameter has been removed from GroupAdd, and that PixelGetColor/PixelSearch now use RGB by default. However, Coco's functions already address these issues. [EDIT:] FileSetAttrib and FileSetTime have replaced 2 parameters with 1 and so I've provided updated functions above.

Perhaps one should suggest that PixelGetColor/PixelSearch should have 'BGR' as an option for Param4. I.e. you notice the issue and so are compelled to mention it, [EDIT:] whether you feel strongly about it or not. It could well be useful to people, I know I've often had to deal with both RGB and BGR. It might be the best option to allow AHK v2, or both AHK v1 and v2 to accept both RGB and BGR in Param4.

It's changes that affect *existing* commands/functions, that keep their name, that are the most confusing. It is difficult to find the best way to present all the AHK v2 changes, perhaps there should be an alphabetical list of all commands/functions/directives/variables mentioning any changes for AHK v2, with a separate bit on syntax and any other changes. I might take some steps towards this in coming weeks.

Ultimately I hope to create the documentation and converter scripts that will make the transition realistic for the average (and expert) user. My list of 17 issues regarding AHK v2, and comments on identifying continuation sections (prior to converting individual lines) are a good start for anyone interested in the meantime.

[docs for v1]
GitHub - Lexikos/AutoHotkey_L-Docs: Documentation for AutoHotkey
https://github.com/Lexikos/AutoHotkey_L-Docs

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



[docs for v2]
GitHub - Lexikos/AutoHotkey_L-Docs at v2
https://github.com/Lexikos/AutoHotkey_L-Docs/tree/v2

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

coffee
Posts: 45
Joined: 01 Apr 2017, 07:55

Re: commands as functions (AHK v2 functions for AHK v1)

03 Apr 2017, 18:14

A V2-like msgbox, doesn't accept string like okcancel for msgbox type as it does in v2, but returns button pressed or can be a var passed as byref. The Problem I found with using coco's version was the parameter order is different between v1 and v2, so msgbox(params) code would have to differ depending on version, making it a pita to test code between the two, this sort of unifies that as long as you stick to numbers for the msgbox type. I just didnt want to do a regexmatch to allow it to use strings for msgbox type, since regexmatch differs a little between V1 and V2.
Works for my use case, can't guarantee it will account for everyone's.
Too bad i had to dirty it up using cancer command ifmsgbox with returns to prevent it from continuing once it finds a match as there is no else for it as far as im aware.

Rules
- Return value: Button that was pressed, like in V2
- Options separated by space or tab, integer value for type of box, and/or timeout seconds (int or float) preceded by T within a string, e.g: "T4"
- Only numbers for the type of msgbox (as in V1), NO strings (like "OKCancel" in V2)
- If using a number as msgbox type, it can be passed within the string
e.g: Msgbox("text", "title", "4 T3", buttonPressed)

- Msgbox type can be a math expression, just dont quote it, and if adding timeout, precede timeout string with a space or tab
e.g: Msgbox("text", "title", 1+3 " T3")

- Timeout is optional and the T in timeout string is case insensitive
- Optional ByRef variable like in V2, value assigned is the button that was pressed

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

User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

Re: commands as functions (AHK v2 functions for AHK v1)

03 Apr 2017, 18:52

I was hoping that Coco and Lexikos would team up again to do nice MsgBox/TrayTip functions, with some good RegEx, as they did with the InputBox function. Until such time, a provisional TrayTip function done to match the style of the others:

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



==================================================

@coffee. Great code, cheers.

AFAIK all the functions are working, apart from MsgBox and TrayTip that needed updating.

Btw these functions are only meant to be for AHK v1, so differences in RegExMatch/RegExReplace shouldn't be an issue.

You could simplify the last bit with:

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


Hmm this reminds me, is it better to break out of a loop first, or is it OK to return while in the middle of a loop?

==================================================

[EDIT:] For two-way compatible output from RegEx, at present that would require objects, and you would check for whether it's v1/v2, and include the letter 'O' and a possibly a close (round) bracket if it's v1.

Some ways to check for v1/v2 at the bottom of this post:
conversion logic, v1 = -> v1 := -> v2, two-way compatibility - Page 4 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=37&t=27069&p=139769#p139769

==================================================

Alphabetical Command and Function Index
https://autohotkey.com/docs/commands/
Alphabetical Command and Function Index
https://lexikos.github.io/v2/docs/commands/index.htm

MsgBox
https://autohotkey.com/docs/commands/MsgBox.htm
MsgBox
https://lexikos.github.io/v2/docs/commands/MsgBox.htm

TrayTip
https://autohotkey.com/docs/commands/TrayTip.htm
TrayTip
https://lexikos.github.io/v2/docs/commands/TrayTip.htm

InputBox
https://autohotkey.com/docs/commands/InputBox.htm
InputBox
https://lexikos.github.io/v2/docs/commands/InputBox.htm
coffee
Posts: 45
Joined: 01 Apr 2017, 07:55

Re: commands as functions (AHK v2 functions for AHK v1)

03 Apr 2017, 23:04

jeeswg wrote:I was hoping that Coco and Lexikos would team up again to do nice MsgBox/TrayTip functions, with some good RegEx, as they did with the InputBox function. Until such time, a provisional TrayTip function done to match the style of the others:

Btw these functions are only meant to be for AHK v1, so differences in RegExMatch/RegExReplace shouldn't be an issue.


Hmm this reminds me, is it better to break out of a loop first, or is it OK to return while in the middle of a loop?


Yeah, I forgot why I even created this, v2 obviously has this already, so its only supposed to run on v1.

For the most part, you should avoid having a clusterfuck of returns, like I had. Multiple returns are ok if they improve readability by using them as guard code and reduce conditional nesting. Generally, only 1 return. I dont think it would harm anything in this case, and would make it shorter.

I regexed the msgbox, using your parse loop at the end to remove the ifmsgbox clutter, just reordered the options by most common in my cases, so they hit first.

Same rules, you can now use the string values of v2 like okcancel etc etc, combined with a timeout with the same format as v2 and you can also use integers mixed in here to get the msgbox type.
So in options parameter, it can be "canceltryagaincontinue 16 768 t4" or "4 iconx t3 default2" or... you get the drift.
Had to create an array (boxtypearray) of the string options from v2 with their numerical values to make it static and not have to do another loop to convert values with a bunch of ifs. So the idea is, use it like v2 and get the options right lol. The array declaration is inside the else, so it is only filled in that condition.
It retains being able to use the math expressions, for instance, ..."title", 1+16 " default2 t3", outputvar
Option value grabs the numeric value of the string option for the messagebox type and adds it unto itself, or if it sees an digit only line it grabs the whole thing and adds it unto itself, which is pretty much how you configure the box type.

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

coffee
Posts: 45
Joined: 01 Apr 2017, 07:55

Re: commands as functions (AHK v2 functions for AHK v1)

19 Apr 2017, 05:14

If there's any interest, I removed some redundant logic in my previous post, made the array static, removed a regexmatch, changed the stringsplit to a parse loop for "performance" reasons (according to docs), and compressed lines with some ternary and removal of unneeded braces.
It has the added benefit(?) that if you somehow pass a negative box type number, it will work anyways. In contrast with v2, where it will throw an exception.

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

User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

Re: commands as functions (AHK v2 functions for AHK v1)

22 Jul 2017, 16:25

I've added some modified and new functions (untested). Although there have been other changes to AHK v2 that I haven't implemented.

AFAICS the bulk of the changes have been made now, and I still haven't heard from Coco, so my recommendation would be for a main dev, to take over this project, make it an official lib, and iron out the remaining niggles. Anyone willing to take over can change my functions as maximally or minimally as they wish, to suit their personal coding preferences.

Note: I've updated my list of every command/function etc:
list of every command/function/variable from across all versions - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=27321

==================================================

AutoHotkey v2 alpha (UPDATES) - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=37&t=2120&p=153136#p153136
'Changed parameter order of ControlMove, ControlSend, ControlSetText, WinSetTitle and WinMove to be consistent with other functions.'

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



'Split Control, ControlGet, Drive and DriveGet sub-commands into separate functions (with some renaming).'

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



Btw any ideas on how to differentiate between a ListBox and a ComboBox, other than by getting the class name via WinGetClass? Or to retrieve the version number of the control class? Thanks.
Last edited by jeeswg on 12 Aug 2017, 14:18, edited 4 times in total.
User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

Re: commands as functions (AHK v2 functions for AHK v1)

22 Jul 2017, 16:37

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

User avatar
derz00
Posts: 404
Joined: 02 Feb 2016, 17:54
GitHub: derz00
Location: Middle of the round cube

Re: commands as functions (AHK v2 functions for AHK v1)

24 Jul 2017, 12:30

Was just going to post here that it looks like no one has split ControlGet, etc into subfunctions. But now I see it in your second last post.

I am trying to convert ControlGet, var, List to var := ControlGetList(). But having no luck. How do you leave the options parameter blank if it is only for ListView? I am using this in a list box. Please excuse my ignorance, if possible. I would like to learn to move away from command syntax.
try it and see
...
User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

Re: commands as functions (AHK v2 functions for AHK v1)

24 Jul 2017, 13:10

This script should do what you want. I put examples for both a listview and a listbox, because you mentioned both. Btw a good place to check for hints is the AHK v2 help.

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

q::
vText1 := ControlGetList("", "SysListView321", "A")
vText2 := ControlGetList("", "ListBox1", "A")
MsgBox, % vText1
MsgBox, % vText2
return

;Control Functions
;https://lexikos.github.io/v2/docs/commands/Control.htm#GetList


Alphabetical Command and Function Index
https://autohotkey.com/docs/commands/
Alphabetical Function Index
https://lexikos.github.io/v2/docs/commands/index.htm
User avatar
derz00
Posts: 404
Joined: 02 Feb 2016, 17:54
GitHub: derz00
Location: Middle of the round cube

Re: commands as functions (AHK v2 functions for AHK v1)

24 Jul 2017, 15:10

OK, I guess I was forgetting quote marks around parameters. I was thinking that was needed only for literal strings. But maybe that's what parameters are, unless they're a variable. I think I'm learning.

Hmm, But I have some functions working with blank parameters without the quote marks...???

EDIT: This is my specific problem. Code:

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

vText := ControlGetList(,CrlNN, "My Window")

WinGetPos(X, Y, Wi, He, "My Window")


SciTE error:

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

C:\Users\users\Documents\AutoHotkey\Lib\WinGetPos.ahk (1) : ==> Functions cannot contain functions.
Specifically: WinGetPos(ByRef X:="", ByRef Y:="", ByRef Width:="", ByRef Height:="", WinTitle:="", WinText:="", ExcludeTitle:="", ExcludeText:="")


I am convinced that I am an idiot.
try it and see
...
coffee
Posts: 45
Joined: 01 Apr 2017, 07:55

Re: commands as functions (AHK v2 functions for AHK v1)

24 Jul 2017, 15:55

derz00 wrote:OK, I guess I was forgetting quote marks around parameters. I was thinking that was needed only for literal strings. But maybe that's what parameters are, unless they're a variable. I think I'm learning.

Hmm, But I have some functions working with blank parameters without the quote marks...???

In expressions, text without quotes are variables and with quotes are strings. Function(variable, "string"). If you have function parameters without quotes, then it's a variable and you are just evaluating it and passing it to the function.

At this point, if you are going through all the trouble to make v1 commands/functions like v2 functions and full expression syntax, why not use v2? You are already making the changes and using functions, finish it up by doing the remaining changes and start using v2. Any changes lexicos makes from current v2 081a onwards will probably be much easier to adapt to than cracking your skull on trying to make v1 like v2. v2 078 had a lot of similarities with v1, but on the current release, there's no ambiguity on what strings and variables are.
User avatar
derz00
Posts: 404
Joined: 02 Feb 2016, 17:54
GitHub: derz00
Location: Middle of the round cube

Re: commands as functions (AHK v2 functions for AHK v1)

24 Jul 2017, 16:33

True enough. I wanted to start writing my new scripts to be compatible with v2, but not really having time to switch all my main scripts. But I guess I should focus on that...
try it and see
...
User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

Re: commands as functions (AHK v2 functions for AHK v1)

24 Jul 2017, 16:39

@coffee: I have a massive amount of conversion to do, and the best approach would be to make my AHK v1 scripts more and more AHK v2-like, until I then jump over to AHK v2. The only way I've tried to make v1 more like v2 is by creating the functions, but I had always wanted function versions of commands anyway, and polyethene and (later I found out) Coco had already done a lot of work on this, so to do the project was a no-brainer. It's a fair but not massive amount of effort to make the functions, however, if the main devs want the functions to meet their exact specifications, e.g. error handling etc and answers to Coco's queries (see 'Useful comments regarding the functions' above), it would be more efficient for them to enact the final touches.

I plan to do some tutorials, some GUI work, and some miscellaneous stuff, and I'll then finish converting my main scripts, and share my converter scripts. It is generally better to know all the details of the problem before you try to solve it, I have had to reconvert certain functions, and I will have to rewrite various parts of my converter scripts, so it is prudent to delay conversion to a certain extent cf. rushing in.

Considering how to deal with double quotes, continuation sections, dereferencing, and one-line/multi-line verbatim text (I believe I have reasonable workarounds with which to proceed, however, perhaps a Verbatim command and/or continuation section enhancements are in order), has been a bit of a headache, even if you don't ask for two-way compatibility.
User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

Re: commands as functions (AHK v2 functions for AHK v1)

12 Aug 2017, 14:41

This post takes me up-to-date with present AHK functions AFAIAC. [Note: I will add here in future: FileRead/FileAppend updates.]

Here are some more function updates/additions based on changes from this post onwards:
AutoHotkey v2 alpha (UPDATES) - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=37&t=2120&p=153136#p153136

As ever, do notify of any issues, and thanks again to the writers of AutoHotkey.

FileSetAttrib
InputEnd
RandomSeed

RegDelete
RegDeleteKey
RegRead
RegWrite

WARNING: I have not thoroughly tested the registry functions, only use them if you are expert, and test carefully on a safe area of the registry before any widescale use. Although Coco did an excellent job on all functions, it seems he didn't consider registry functions for use within a registry loop, which I have tried to achieve.

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



- AFAIK a ClipboardAll function is impossible for AHK v1, although I believe a workaround is:
ClipSaved := IsFunc("ClipboardAll") ? ClipboardAll() : ClipboardAll

- I am not sure if registry loop handling has been added for RegDeleteKey.
- Also, I believe a 'RegCreateKey' function is needed for AutoHotkey, to create a key without creating a value. I.e. RegWrite/RegCreateKey cf. RegDelete/RegDeleteKey.
- I believe that some key logic for handling key names is as follows:

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

if InStr(KeyName, "\")
RegDelete %KeyName%, %ValueName%
else
RegDelete %KeyName%,, %ValueName%

- A_LoopRegKey in AHK v1 is somewhat confusingly named, it is always the root key.
- Handy links:
https://autohotkey.com/docs/commands/LoopReg.htm
https://autohotkey.com/docs/commands/RegDelete.htm
https://autohotkey.com/docs/commands/RegRead.htm
https://autohotkey.com/docs/commands/RegWrite.htm
https://lexikos.github.io/v2/docs/commands/LoopReg.htm
https://lexikos.github.io/v2/docs/commands/RegDelete.htm
https://lexikos.github.io/v2/docs/commands/RegRead.htm
https://lexikos.github.io/v2/docs/commands/RegWrite.htm
Last edited by jeeswg on 24 Aug 2017, 21:55, edited 1 time in total.
User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

Re: commands as functions (AHK v2 functions for AHK v1)

24 Aug 2017, 19:02

I will finish FileRead and FileAppend [EDIT: Done.], and post a complete set of 'AHK v2 functions for AHK v1' soon.

Since functions are of the form:
Text := FileRead(Filename, Options)
and AHK v2 is introducing special handing for binary variables, I believe that, like the ClipboardAll function, you could not have a two-way compatible way, via replicating AHK v2 functions, of creating a binary variable via FileRead.

To achieve two-way compatibility for scripts that read binary data to a variable, you would have to create a custom function using a ByRef variable, or perhaps you could use a File object instead.

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

User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

Re: commands as functions (AHK v2 functions for AHK v1)

24 Aug 2017, 22:12

Note: the RegDelete and RegWrite functions are untested, in case anyone has a virtual machine they can test them on.

Note: I noticed that force expression was used on SplitPath, I am not sure if any other parameters require this.

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

User avatar
derz00
Posts: 404
Joined: 02 Feb 2016, 17:54
GitHub: derz00
Location: Middle of the round cube

Re: commands as functions (AHK v2 functions for AHK v1)

07 Sep 2017, 17:49

jeeswg wrote:

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




About this MsgBox() function.

What do you mean by ; >> r_PressedButtonVar === same as in V2, optional ByRef variable for button that was pressed ? Am I missing something?
try it and see
...
User avatar
jeeswg
Posts: 3552
Joined: 19 Dec 2016, 01:58
Location: UK

Re: commands as functions (AHK v2 functions for AHK v1)

07 Sep 2017, 18:07

That function was written by coffee (the only function I didn't write myself apart from perhaps InputBox and Type). Basically the variable should contain Yes/No etc based on which MsgBox button you clicked/pressed. AHK v2 doesn't use the IfMsgBox command.

Hmm, I don't see it here:
MsgBox
https://lexikos.github.io/v2/docs/commands/MsgBox.htm

Perhaps the function definition was changed. I might investigate ...

lexikos did a nice function for InputBox with some quite advanced RegEx, so I was waiting for him to do a nice function for MsgBox, rather than do one that was potentially lame by comparison. I'll review the current MsgBox function at some point. I'll try to rewrite it to match the other functions, hopefully within the next 24 hours.

[EDIT:]
AutoHotkey v2 alpha (UPDATES) - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=37&t=2120&p=153136#p153136
•Removed MsgBox's redundant OutputVar.


==================================================

[EDIT:]
Well, the InputBox function's RegEx makes use of (*ACCEPT) which is mentioned here, but in the end isn't used in the MsgBox function at present.
Default/Portable installation StdLib - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=13&t=10434&p=74978#p74978
Default/Portable installation StdLib - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=13&t=10434&p=75262#p75262

I've changed the MsgBox function to make it more consistent with the other functions. The code hasn't really changed apart from replacing += with |=.

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


Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 3 guests