Search found 6503 matches

by lexikos
04 Apr 2020, 20:59
Forum: AutoHotkey v2 Development
Topic: [v2.106+] BaseType
Replies: 5
Views: 428

Re: [v2.106+] BaseType

BaseObj must be an Object. If assigning the new base would change the native type of the object, an exception is thrown. An object's native type is decided by the nearest prototype object belonging to a built-in class, such as Object.Prototype or Array.Prototype . For example, an instance of Array ...
by lexikos
04 Apr 2020, 20:44
Forum: Wish List
Topic: Allow Binding of ByRef Parameters via Bind() Method
Replies: 2
Views: 136

Re: Allow Binding of ByRef Parameters via Bind() Method

It's probably rare that this would be used with a global variable in a real script. Limitations of the current implementation would prevent this from being used safely with local variables, since each local variable is in fact a sort of singleton object; the variable always belongs to the top-most i...
by lexikos
21 Feb 2020, 20:19
Forum: AutoHotkey v2 Development
Topic: [v2.108 - BUG?] Slow Loop Parse for expression
Replies: 14
Views: 1791

Re: [v2.108 - BUG?] Slow Loop Parse for expression

It is to be expected that Loop Parse, String is faster than Loop Parse, (1, String) . Although technically an expression, the former is not evaluated as such due to optimizations. The problem here is that sDerefBuf of previous line (Loop) is taken over by next line(s) so SET_DEREF_TIMER is launched ...
by lexikos
21 Feb 2020, 18:39
Forum: Bug Reports
Topic: I think there is a error in c++ source "Util_WinKill"
Replies: 6
Views: 955

Re: I think there is a error in c++ source "Util_WinKill"

yezilaoda You are right; I don't see how that could ever have worked. A simple test with the following "unresponsive program" shows that WinKill is ineffective (without your changes). SetTimer freeze, -100 MsgBox freeze: DllCall("Sleep", "int", 1000000) lmstearn There is no indication in the Micros...
by lexikos
21 Feb 2020, 17:15
Forum: Bug Reports
Topic: InputHook sees multiple press/release events for single press of NumLock
Replies: 1
Views: 812

Re: InputHook sees multiple press/release events for single press of NumLock

When the hook suppresses NumLock, it generates extra events to ensure the NumLock state does not change. // This handles the troublesome Numlock key, which on some (most/all?) keyboards // will change state independent of the keyboard's indicator light even if its // keydown and up events are suppre...
by lexikos
21 Feb 2020, 16:48
Forum: Ask For Help
Topic: Problem with Hotstring()
Replies: 3
Views: 287

Re: Problem with Hotstring()

The Z option causes the hotstring recognizer to be reset whenever the hotstring is recognized. As a matter of fact, the option is put into effect for auto-replace hotstrings. However, auto-replace hotstrings do their own partial or full reset prior to that, so the Z option only affects the End Char,...
by lexikos
08 Feb 2020, 00:06
Forum: Bug Reports
Topic: Erroneous error message?
Replies: 3
Views: 1336

Re: Erroneous error message?

ListLines and the error messages show a rough reproduction of the source code based on the "semi-compiled" state of the script. The text of each expression is kept, but the overall text of commands is not; it is reproduced from the command index and text of each parameter. Each parameter might have ...
by lexikos
07 Feb 2020, 23:22
Forum: Bug Reports
Topic: [a108] BoundFunc.MaxParams incorrect output
Replies: 1
Views: 912

Re: [a108] BoundFunc.MaxParams incorrect output

It is a conscious design choice, and is directly comparable to a user-defined implementation of a bound function. Consider f1(p*) => f2(p*) f1 has no maximum parameter count, but it will still fail if you pass more parameters than f2 can accept. The BoundFunc type also covers ObjBindMethod. In that ...
by lexikos
07 Feb 2020, 23:11
Forum: Ask For Help
Topic: Odd CheckBox behavior when Gui quickly disabled
Replies: 5
Views: 602

Re: Odd CheckBox behavior when Gui quickly disabled

While external code is executing... internal code is not. It is to be expected that the GUI will not respond if incoming messages are not being processed; i.e. because the message loop (the code which pulls messages from the queue and dispatches them) cannot execute, because the thread is executing ...
by lexikos
07 Feb 2020, 23:03
Forum: Bug Reports
Topic: Ctrl key gets stuck when Altgr key is used in ahk script
Replies: 5
Views: 2645

Re: Ctrl key gets stuck when Altgr key is used in ahk script

Several bugs relating to AltGr have been fixed since this topic was started (five years ago). I suggest that you start a new topic in the Ask for Help forum, after confirming that you have the latest AutoHotkey release (v1.1.32.00) on all computers. Including code in your post may improve the odds t...
by lexikos
07 Feb 2020, 22:45
Forum: Wish List
Topic: "FileExist" suggestion.
Replies: 1
Views: 931

Re: "FileExist" suggestion.

v2 has DirExist. It should be back-ported to v1. If the folder contains files and folders, I don't think there's any guarantee that FileExist will return the attributes of a folder. To be safe, you can use a single-iteration folder loop: DirExist(pattern) { Loop Files, % pattern, D return true retur...
by lexikos
07 Feb 2020, 22:28
Forum: Wish List
Topic: Send {Raw} / {Text} terminators
Replies: 2
Views: 889

Re: Send {Raw} / {Text} terminators

Having any symbol, keyword or combination of characters that is given special meaning within the {Raw} mode would defeat the purpose. For instance, your script would fail if you have copied the text of your post, since %clipboard% would contain {EndRaw} which was intended to be literal, but would in...
by lexikos
07 Feb 2020, 22:05
Forum: AutoHotkey_H
Topic: ObjRawGet/ObjRawSet abnormal
Replies: 5
Views: 1009

Re: ObjRawGet/ObjRawSet abnormal

ObjRawGet is effectively "ObjGetOwnProp". Because I wasn't sure that I wanted to keep it, I made only the minimal changes needed to get it working.

If you want to map object references to values, use a Map.
by lexikos
07 Feb 2020, 21:59
Forum: Bug Reports
Topic: Sizing GUI-Elements: dpi dpiaware has to be set to "True/PM" to work on Win 8.1 and above
Replies: 12
Views: 5293

Re: Sizing GUI-Elements: dpi dpiaware has to be set to "True/PM" to work on Win 8.1 and above

If the MsgBox was created by a different Windows thread than the script, it would not affect the script's DPI awareness context. On the contrary, the problem is that there is only one thread, and only one value per thread. When you call MsgBox, some system code creates the dialog, displays it, and r...
by lexikos
07 Dec 2019, 20:13
Forum: AutoHotkey v2 Help
Topic: Acquiring class references.
Replies: 3
Views: 1318

Re: Acquiring class references.

The other built-in classes don't actually exist yet, just the prototypes.
by lexikos
07 Dec 2019, 20:02
Forum: Bug Reports
Topic: If statement changes contents of var
Replies: 14
Views: 3733

Re: If statement changes contents of var

If (int1 := "12345678901234567890"){ This will assign the value and always execute the if statement, because the value is true. Of course, there would be more sensible cases, where the value being assigned is not a constant. But the inline assignment is immaterial anyway. The issue is with variable...
by lexikos
07 Dec 2019, 19:32
Forum: AutoHotkey v2 Help
Topic: function objects example
Replies: 7
Views: 1777

Re: function objects example

Arr[A_Index] does not do bound-checking in v1, at least in any way that directly relates to A_Index . There are no such bounds to check, because Arr is an associative array. It just does key lookup, which is not O(1). Arr[A_Index] does bound-checking in v2, assuming Arr is Array , because it is imp...
by lexikos
07 Dec 2019, 19:08
Forum: Wish List
Topic: HasKey(): Support for Multidimensional Arrays
Replies: 5
Views: 1822

Re: HasKey(): Support for Multidimensional Arrays

At this time, I have no intention of improving support for multi-dimensional arrays in v1, or supporting them at all in v2.0 . (That is, aside from the inherent ability of the __Item property to accept parameters, and any other already-present capabilities that a script can utilize to implement mult...
by lexikos
07 Dec 2019, 19:02
Forum: Bug Reports
Topic: ❌ [a108] Lambda expression unable to capture a for-loop's variables
Replies: 4
Views: 1658

Re: [a108] Lambda expression unable to capture a for-loop's variables

Variables are captured by reference , not by value. There is only one variable named item , not one for each iteration. This is a common mistake in Javascript. One small difference here is that when our for-loop completes, it restores the variable to the value it had prior to the loop (nothing), so ...
by lexikos
07 Dec 2019, 18:53
Forum: Scripts and Functions
Topic: Upcoming Ahk2Exe Changes (2019)
Replies: 314
Views: 42031

Re: Upcoming Ahk2Exe Changes (2019)

v1.1.33.00, although I currently have nothing else planned for that release. When the documentation is ready for release, submit a pull request - this improves the odds that I won't forget about it. :facepalm:

Go to advanced search