Search found 50 matches

by lvalkov
26 Jan 2020, 09:23
Forum: AutoHotkey v2 Help
Topic: How does V2 implement this V1 code?
Replies: 17
Views: 602

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: AutoHotkey v2 Help
Topic: How does V2 implement this V1 code?
Replies: 17
Views: 602

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: AutoHotkey v2 Help
Topic: ObjLength() equiv in v2?
Replies: 8
Views: 314

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: AutoHotkey v2 Help
Topic: ObjLength() equiv in v2?
Replies: 8
Views: 314

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: AutoHotkey v2 Help
Topic: ObjLength() equiv in v2?
Replies: 8
Views: 314

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
Topic: Facade Functional Programming Suite
Replies: 66
Views: 7754

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 v2 Development
Topic: [SUGGEST][AHKv2.0-a108] types
Replies: 6
Views: 515

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: 0
Views: 134

[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: AutoHotkey v2 Help
Topic: [v2.0-a108] Simple __Enum example please Topic is solved
Replies: 4
Views: 361

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: AutoHotkey v2 Help
Topic: [v2.0-a108] Simple __Enum example please Topic is solved
Replies: 4
Views: 361

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
Topic: Sort list of file paths in folder\subfolders order Topic is solved
Replies: 6
Views: 469

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: 1101

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...
by lvalkov
08 Dec 2019, 09:44
Forum: Bug Reports
Topic: ❌ [a108] Lambda expression unable to capture a for-loop's variables
Replies: 4
Views: 1101

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

Okay, I will work around this using Func/Bind or nested function wrappers.
by lvalkov
07 Dec 2019, 18:47
Forum: Bug Reports
Topic: ❌ [a108] Lambda expression unable to capture a for-loop's variables
Replies: 4
Views: 1101

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

Not a bug as per: Variables are captured by reference ... Given an Array A , for each element, store a capturing lambda in Array B . Later, invoke them, yielding the following erroneous results: A := [1, 2, 3] B := [] for item in A B.Push(() => MsgBox(item)) %B[1]%() ; MsgBox(''), expected MsgBox('...
by lvalkov
28 Sep 2019, 08:53
Forum: AutoHotkey v2 Help
Topic: extends Array
Replies: 3
Views: 1012

Re: extends Array

I believe the goal is to circumvent the laborious process of (mostly) manually defining Array extension methods, according to the template: Array.Prototype.DefineMethod('extensionMethod', this => (/* implementation details */)) by defining a class instead, having it extend Array (so as to inherit Ar...
by lvalkov
27 Sep 2019, 17:53
Forum: AutoHotkey v2 Development
Topic: ✅ [a105] CHM Search tab performance degradation Topic is solved
Replies: 2
Views: 2281

✅ [a105] CHM Search tab performance degradation Topic is solved

This issue has been resolved as of: Fix performance issue due to attaching same event multiple times. Having just recently updated to a105 , I observe a slight, albeit rather annoying, performance regression when accessing most items in the Search tab. The other tabs aren't affected. Previous versi...
by lvalkov
09 Apr 2019, 14:24
Forum: Ask For Help
Topic: Creating a floating toolbar in PowerPoint
Replies: 1
Views: 240

Re: Creating a floating toolbar in PowerPoint

You might be interested in taking a look at this thread.
by lvalkov
09 Apr 2019, 14:22
Forum: Ask For Help
Topic: How to identify the current GUI default window? Topic is solved
Replies: 4
Views: 631

Re: How to identify the current GUI default window? Topic is solved

No. Clicking on the GUI1 window doesn't affect which GUI is the default one. Unless, of course, you're talking about clicking the button labeled "Close" , belonging to GUI1, in which case, yes, the default GUI for the "Close" button thread will be set to GUI1. I've already explained this interaction...

Go to advanced search