Search found 58 matches

by lvalkov
11 Jul 2021, 06:55
Forum: Ask for Help (v2)
Topic: [a138] Invalid hotkey declarations permitted Topic is solved
Replies: 1
Views: 1034

[a138] Invalid hotkey declarations permitted Topic is solved

[Moderator's note: Topic moved from Bug Reports.] Seemingly invalid modifier combinations are accepted as valid hotkeys without raising any loading or runtime errors. #Requires AutoHotkey v2.0-a138-7538f26f #Warn All Hotkey('<#<#<#<#<^<!<+>#>#>#>#>^>!>+', (ThisHotkey) => '') <#<#<#<#<^<!<+>#>#>#>#>...
by lvalkov
27 Jun 2021, 20:56
Forum: Bug Reports
Topic: [a138] Misplaced catch-as clause causes a Critical Error crash Topic is solved
Replies: 2
Views: 1423

[a138] Misplaced catch-as clause causes a Critical Error crash Topic is solved

With the following piece of code, I am able to cause a runtime Critical Error crash once the execution reaches the catch as OutputVar clause following else : try MsgBox 'try' catch MsgBox 'catch' else MsgBox 'else' catch as ErrorException MsgBox 'catch as ErrorException' Critical Error: Invalid memo...
by lvalkov
24 Jun 2020, 19:45
Forum: AutoHotkey Development
Topic: [a112] Refactor the Object-delegating GuiType::Invoke; Simplify inheriting Topic is solved
Replies: 1
Views: 2011

[a112] Refactor the Object-delegating GuiType::Invoke; Simplify inheriting Topic is solved

v2.0-a112 saw the removal of GuiCreate() and the introduction of Gui , exposed as a class of its own. This opens up the possibility to inherit from it, which in some (arguably most) cases can prove a tad cumbersome, requiring additional (undesirable) boilerplate and paying extra attention to the or...
by lvalkov
24 Jun 2020, 18:50
Forum: Ask for Help (v2)
Topic: [a108] #DllLoad/DllCall fails to automatically resolve func name Topic is solved
Replies: 6
Views: 2523

Re: [a108] #DllLoad/DllCall fails to automatically resolve func name Topic is solved

There is [...] no intention to implement this, because it is a bad idea. I cannot help but disagree with that conclusion of yours. Taken to the extreme, perhaps, it very well might be. Then again, that is universally true of almost anything. It is a matter of trade-offs with respect to convenience,...
by lvalkov
24 Jun 2020, 17:39
Forum: AutoHotkey_H
Topic: [v1.1.32.00] AhkExported + AhkPostFunction from thread results in a crash Topic is solved
Replies: 1
Views: 3045

[v1.1.32.00] AhkExported + AhkPostFunction from thread results in a crash Topic is solved

AhkThread("AhkExported().AhkPostFunction(""threadCallback"", ""Sent from thread."")") threadCallback(msg) { MsgBox % msg } MsgBox Executing the above snippet with AutoHotkey_H v1.1.32.00 ( 434d51 ) results in the thread callback message box being shown briefly, after which point the parent script h...
by lvalkov
21 Apr 2020, 19:27
Forum: Ask for Help (v2)
Topic: [a108] #DllLoad/DllCall fails to automatically resolve func name Topic is solved
Replies: 6
Views: 2523

Re: [a108] #DllLoad/DllCall fails to automatically resolve func name Topic is solved

Having now examined the source more closely, I can tell that there is, indeed, no implementation (yet?) for looking up the names of functions in #DllLoad ed modules. The remark in the documentation ("Performance" section) is misleading. Is such a feature in the works? It seems useful and not too ove...
by lvalkov
20 Apr 2020, 14:24
Forum: Ask for Help (v2)
Topic: [a108] #DllLoad/DllCall fails to automatically resolve func name Topic is solved
Replies: 6
Views: 2523

[a108] #DllLoad/DllCall fails to automatically resolve func name Topic is solved

If DllCall 's first parameter is a literal string such as "MulDiv" and the DLL containing the function is ordinarily loaded ("resides in User32.dll , Kernel32.dll , ComCtl32.dll , or Gdi32.dll ") before the script starts, or has been successfully loaded with #DllLoad , the string is automatically r...
by lvalkov
18 Apr 2020, 18:31
Forum: Bug Reports
Topic: ✅ [a108] InputHook MatchList: Invalid pointer read
Replies: 0
Views: 1014

✅ [a108] InputHook MatchList: Invalid pointer read

This issue has been resolved as of: PR #172 (Helgef): Fixed crashes relating to InputHook match list. Loop 1025 matchList .= A_Index ',' matchList := RTrim(matchList, ',') ih := InputHook('', '', matchList) MsgBox ; Has already crashed by this point. ResultType input_type::SetMatchList(LPTSTR aMatc...
by lvalkov
26 Jan 2020, 09:23
Forum: Ask for Help (v2)
Topic: How does V2 implement this V1 code?
Replies: 22
Views: 6215

Re: How does V2 implement this V1 code?

perhaps you forgot setbatchlines -1 when testing in v1. No. I had simply copied arcticir 's snippet and executed it with the 1.1.32.00 interpreter ( "implement this V1 code" implying v1). I failed to account for the fact that the piece of code was, indeed, not v1-compliant ( t:=random(1,100) ). Unf...
by lvalkov
25 Jan 2020, 18:00
Forum: Ask for Help (v2)
Topic: How does V2 implement this V1 code?
Replies: 22
Views: 6215

Re: How does V2 implement this V1 code?

You speak of "increased complexity", "loss of flexibility" and "lackluster performance" when in reality you couldn't be further from the truth. The last solution posted by user Helgef executes about half an order of magnitude faster than the stock v1 sample. (See edit below.) Flexibility would have ...
by lvalkov
25 Jan 2020, 17:03
Forum: Ask for Help (v2)
Topic: ObjLength() equiv in v2?
Replies: 8
Views: 2533

Re: ObjLength() equiv in v2?

"Best" is rather vague and largely dependent on your goals and needs. I can only compare different approaches. At the end of the day, however, you will have to decide whether any of them fits your particular use-case, and if so, which one does it best . Conditionals arrLen := (A_AhkVersion < "2") ?...
by lvalkov
23 Jan 2020, 00:49
Forum: Ask for Help (v2)
Topic: ObjLength() equiv in v2?
Replies: 8
Views: 2533

Re: ObjLength() equiv in v2?

MsgBox ObjLength[Arr] works too. For now. I see no practical reason to recommend the indexing operator for invoking function references as opposed to the standard way of doing so - %fn%() . thanks, what makes a property "dynamic"? A dynamic property is one that implements a getter , a setter or bot...
by lvalkov
22 Jan 2020, 17:12
Forum: Ask for Help (v2)
Topic: ObjLength() equiv in v2?
Replies: 8
Views: 2533

Re: ObjLength() equiv in v2?

Dynamic properties necessarily have to invoke a function for them to work at all - either get or set , depending. It's only a matter of retrieving a reference to that function. Arr := [1, 2, 3, 4] ObjLength := Array.Prototype.GetOwnPropDesc('Length').Get len := %ObjLength%(Arr) MsgBox len Built-in s...
by lvalkov
22 Jan 2020, 17:03
Forum: Scripts and Functions (v1)
Topic: Facade Functional Programming Suite
Replies: 80
Views: 27209

Re: Facade Functional Programming Suite

As several asides… AutoHotkey v2's new Map type is poorly named because Map is an old, standard, widely recognized name for a function that returns a sequence containing the results of applying a function to each respective element of another sequence. A port of Facade to v2 would have to use a fun...
by lvalkov
19 Jan 2020, 22:18
Forum: AutoHotkey Development
Topic: [SUGGEST][AHKv2.0-a108] types
Replies: 6
Views: 3569

Re: [SUGGEST][AHKv2.0-a108] types

Really we just need a simple and concise way to determine if what is held in a variable is callable . variable.HasMethod('Call') Very elegant solution from swagfag but actually not the complete solution. I fail to see how the provided solution is incomplete. In order to deem an object "callable" , ...
by lvalkov
18 Jan 2020, 20:57
Forum: Bug Reports
Topic: [a108] BoundFunc.MaxParams incorrect output
Replies: 1
Views: 2199

[a108] BoundFunc.MaxParams incorrect output

Querying MaxParams on any bound function object (created with Bind() ) incorrectly * returns 0 instead of: the base function's actual parameter count; or the number of remaining unbound parameters (up to the variadic for variadic functions). f(a, b, c, d*) { } f := Func('f') MsgBox f.MaxParams ; 3, ...
by lvalkov
06 Jan 2020, 18:04
Forum: Ask for Help (v2)
Topic: [v2.0-a108] Simple __Enum example please Topic is solved
Replies: 4
Views: 2927

Re: [v2.0-a108] Simple __Enum example please Topic is solved

I reckon simply delegating to the OwnProps() enumerator might suffice in your particular case.

Code: Select all

class ...
{
    __Enum(*) => this.OwnProps()
}

for key, Spec in ClassInstance
{
	... key ...
	... Spec.Nm ...
	.... Spec.Dt ...
}
by lvalkov
05 Jan 2020, 15:38
Forum: Ask for Help (v2)
Topic: [v2.0-a108] Simple __Enum example please Topic is solved
Replies: 4
Views: 2927

Re: [v2.0-a108] Simple __Enum example please Topic is solved

For a primer on enumerators, click here.
As a direct result of the unclear layout of your object and poorly defined expectations as to what data the enumerator is meant to enumerate, unfortunately, I am unable to further assist you in implementing an __Enum method.
by lvalkov
26 Dec 2019, 04:15
Forum: Ask for Help (v1)
Topic: Sort list of file paths in folder\subfolders order Topic is solved
Replies: 6
Views: 1409

Re: Sort list of file paths in folder\subfolders order Topic is solved

Implemented in v2-a108.
Backporting to v1 would necessitate substituting the Map for another case-sensitive collection, such as a Scripting.Dictionary or a different homebrewed one.
by lvalkov
10 Dec 2019, 00:34
Forum: Bug Reports
Topic: ❌ [a108] Lambda expression unable to capture a for-loop's variables
Replies: 4
Views: 2767

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

joefiesta Each of the code samples, submitted thus far, can be run in isolation and is guaranteed to, at the very least, 'execute' on the version targeted by this bug report. I have settled on resolving my issue using Func / Bind . If you are looking for an example of that, look no further than cod...

Go to advanced search