v2.1-alpha.9

Discuss the future of the AutoHotkey language
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

v2.1-alpha.9

23 Jun 2023, 02:22

v2.1 downloads

v2.1-alpha.1

Based on v2.0.3.

Changes

Improved RegExReplace with the ability to pass a callback function instead of replacement text, based on PR #307 by thqby.
Added WinGetEnabled.
Added WinGetAlwaysOnTop.
Added an optional Filename parameter to Edit.
Added the OnMessage method to the Gui class, based on code by thqby.
Added modeless menus.
  • Allows new threads to run without freezing the menu.
  • Allows the tray menu to be opened without stalling the current thread.
  • Added Wait parameter (#3) to Menu.Prototype.Show (defaults to true, i.e. modal menu).
Added ATan2(y, x). [PR #319 by sswwaagg]

Includes changes from the v1.1 branch:
  • Added support for ByRef VARIANT in incoming COM calls. (This was already supported in v2.)
  • Fixed omitted IDispatch params to translate to SYM_MISSING.
  • Added support for two-variable enumerators (for-loops) with IDispatch-wrapped AutoHotkey objects.

Notes

Documentation is on the alpha branch and included in the downloads. As of v2.1-alpha.3, it is also available at https://autohotkey.com/docs/alpha/

Running the installer directly will install to the "v2" sub-directory, as this is the default behaviour for "upgrade" installs (and the UX scripts are unchanged from v2.0.3). This caused issues with v2.0.5 of thqby's AutoHotkey v2 Language Support extension (but newer versions should work). To instead install it to the "v2.1-alpha.1" sub-directory, run AutoHotkeyUX.exe install.ahk /install "SOURCE", where SOURCE should be replaced with the path of a directory where you have extracted the v2.1 files. Alternatively, the interpreter path can be set to a v2.0 interpreter in the extension's settings.

If you do not wish to run scripts with v2.1-alpha by default, ensure you have installed at least v2.0.3 the normal way, and change the v2 build preference in the launcher settings from 64-bit to 64-bit, <2.1- (or 32-bit if that's your preference). This can be done in the GUI by typing or pasting into the ComboBox. If a script #Requires AutoHotkey v2.1-alpha.1, it will still run with the alpha.

https://www.autohotkey.com/download/2.1/version.txt now contains the latest v2.1 version.
https://www.autohotkey.com/download/versions.txt now contains a line for the latest v2.1 version.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

v2.1-alpha.2

12 Aug 2023, 06:50

Fixes
Fixed load-time checks not detecting missing parameters for MenuSelect.
Fixed popup menus popping under the active GUI window if it is AlwaysOnTop.

Optimizations
Optimized Pause to allow the OS-level thread to sleep until messages are received, instead of polling the pause state frequently. In testing, this reduced CPU usage from 0.04% to 0.00%.
Optimized ProcessWaitClose and RunWait to allow the OS-level thread to sleep until the process handle is signaled or messages are received. This reduced CPU usage (as above) and improved the response time.
Optimized dialog window class checks.

Changes
Changed ImageSearch and PixelSearch to allow X and Y to be omitted.
Changed ProcessWait to show "STILL WAITING" in ListLines, like WinWait.

Added support for returning unset from functions and properties, and allowing or handling it with the maybe (?) and or-maybe (??) operators.
Added optional chaining with the maybe operator (a?.b).
Added the maybe-assign operator (??=).
Changed property setters to allow the value parameter to be unset.
Improved load-time validation for unset, ? and ??.
Added an experimental directive, #DefaultReturn unset|"".

See the help file in the download for details. The documentation topic "Unset" in particular is heavy on details.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

v2.1-alpha.3

03 Sep 2023, 06:27

Based on v2.0.7.

Documentation is available at https://autohotkey.com/docs/alpha/

There are bugs in this release relating to OTB. Get v2.1-alpha.4 instead.


Changes

Added function definition expressions.
Added typed properties (structures). See Typed properties (forum topic) for some background.
Added Class(Name, BaseClass, Args*) and Class(BaseClass, Args*) (see Class.Call).
Added support for left/right modifiers in {Blind}, as in {Blind>^}.
Changed remapping to utilize left/right modifiers in Blind; e.g. >^a::b remaps RCtrl-A to B and LCtrl-RCtrl-A to LCtrl-B, instead of just B.
Changed DllCall to permit CDecl to be omitted for all functions (see CDecl).
Revised parsing of statements. Global, local and static variable declarations with multiple initializers are now evaluated as one, so there is no need to step over each initializer individually while debugging.
Changed ListVars to show unset vars as "varname: unset".
Changed Throw to be a function, permitting thrown errors to be continuable (see Throw).


Changes applicable only to alpha users

Changed (...)? and (...) ?? x to never enable unset return. This eliminates inconsistencies, such as:
  • (a ? b : c)? permitted only c to be unset, while (a ? b? : c)? permitted only b to be unset.
  • (x.y)? permitted y to return unset, while (x?.y)? did not.
Fixed a[b]:=unset for Array and Map.
Fixed debugger failing to return typed sub-properties.
Fixed a? .b.
Fixed f(a?.b?) incorrectly raising a load-time error.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

v2.1-alpha.4

04 Sep 2023, 04:15

Fixed bugs added by v2.1-alpha.3:
  • Control flow statement not being recognized if followed immediately by a brace; e.g. else{.
  • Static properties being erroneously merged into one line; e.g. static Prop { get => 1 }.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

v2.1-alpha.5

17 Sep 2023, 02:10

Changed Ctrl::Alt to not send an unsuppressed {Ctrl up}. This was originally intended to work around an issue with system handling of the modifier keys, but was superseded by a better workaround in v2.0.8.

Added support for using WheelUp, WheelDown, WheelLeft and WheelRight on either side of a remapping.

Removed a length limitation for parameter default strings (but not expressions).

Optimized ternary by removing a redundant check for numericness.

Changes applicable only to alpha users:

Fixed a reference counting error in construction of nested structs.
Fixed issues with function definition expressions (and created more issues :().
  • Script failing to load if the function contains blocks.
  • x::y(h?){ was implicitly permitted but was not behaving intuitively; it is now interpreted as though y was on a new line.
  • Function definitions beginning within a fat arrow function or parameter initializer were incorrectly defined in the outer scope.
  • The function's body was not identified correctly if it began within a fat arrow function, #HotIf, parameter initializer or class variable initializer.
Fixed &x:=unset to be permitted.
Last edited by lexikos on 17 Sep 2023, 03:30, edited 2 times in total.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

v2.1-alpha.6

20 Sep 2023, 05:53

Fixed bugs added by v2.1-alpha.5:
  • return (){ being interpreted like return return (){.
  • Closures not working inside function definition expressions.
  • Some functions not seeing variables which are created due to assume-global assignments.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

v2.1-alpha.7

06 Oct 2023, 21:33

Based on v2.0.10.

Added SetCue method for Edit and ComboBox controls. [PR #315]
Changed FileCreateShortcut's ShortcutKey parameter to permit the ^, + and ! modifiers. [PR #310]
Added A_KeybdHookInstalled and A_MouseHookInstalled. [PR #326]
Added GuiControl.Prototype.OnMessage, utilizing window subclassing.
Changed Menu ToggleCheck/ToggleEnable to return the new state.

Changes applicable only to alpha users:

Fixed Gui.Prototype.OnMessage to set A_EventInfo the same as OnMessage.
Fixed crash on load if the first class var initializer uses =>.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

v2.1-alpha.8

22 Dec 2023, 21:19

Optimized auto-replace hotstrings to avoid retyping an identical leading part, where feasible.

Changed the following to use ASCII-only case insensitivity instead of locale case insensitivity: UseTab method (excluding Exact mode, which was already ASCII-only), Choose method and Text property (Tab control); Add method (Menu).
  • Now consistent with case insensitivity of variable, property and GUI control names.
  • If the intention is to identify a previously added item, it is best (and generally expected) to use the exact same string. Non-ASCII letters such as "À" must be specified in the original case. Canonically equivalent Unicode sequences which are not binary equivalent are no longer considered equal even if they appear identical (e.g. LATIN SMALL LETTER A WITH RING ABOVE (U+00e5) and LATIN SMALL LETTER A + COMBINING RING ABOVE (U+0061 U+030a), which appear as "å").
  • Certain Unicode characters are no longer erroneously ignored for the purpose of comparisons. For example, a menu item name consisting only of these characters was previously considered equal to the divider (empty name): ⮙⮝⮛⮟

Changes applicable only to alpha users:

Fixed A_ThisFunc and dynamic references in parameter default expressions.


(This release includes the bug fixes from v2.0.11; I forgot to merge the v2.0.11 documentation.)
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

v2.1-alpha.9

24 Mar 2024, 00:12

Added rudimentary struct pointers (StructFromPtr).

Changed MouseGetPos to throw OSError if the mouse position cannot be determined.

Changes applicable only to alpha users:

Fixed static var := unset.
Fixed throw() within Catch to re-throw.
Fixed non-struct objects to not be allocated data by default.
Fixed memory leaks during unsuccessful construction of struct classes.
Fixed crashing when block-end immediately follows If/Loop/etc.
Fixed load-time detection of duplicate typed properties.
Fixed crashing when constructing an object which had a property of struct type redefined or deleted.
Fixed object never being deleted if a nested struct __value was invoked.

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 2 guests