Search found 222 matches

by sirksel
25 Jan 2024, 08:25
Forum: Ask for Help (v2)
Topic: Dynamic global declaration workaround?
Replies: 15
Views: 2608

Re: Dynamic global declaration workaround?

lexikos , thanks so much for the help. One quick clarification, and one question: 1. You are right. I foolishly (and incompletely) eliminated the 2 s from Itself2 as I was pasting into my post, resulting in the error that didn't actually exist in my test code. I've learned before never to edit on t...
by sirksel
20 Jan 2024, 14:39
Forum: Ask for Help (v2)
Topic: Dynamic global declaration workaround?
Replies: 15
Views: 2608

Re: Dynamic global declaration workaround?

Sorry to resurrrect this old thread, but I've been successfully using lexikos ' singleton pattern (as embellished by safetycar ), called Itself , for a while now. class Itself { static __new() { if (this.prototype.__Class != "Itself2") { for prop in this.OwnProps() if (prop != "__Init" && prop != "P...
by sirksel
19 Jan 2024, 15:58
Forum: Ask for Help (v2)
Topic: Easy way to show A_TrayMenu?
Replies: 8
Views: 562

Re: Easy way to show A_TrayMenu?

Wow. It is a lot, and some might say excessive, but... your taking time to demonstrate it teaches me (and others who read this) about how all these pieces work together. This was VERY helpful, and I understand the related effects much better now. Thank you!
by sirksel
16 Jan 2024, 22:48
Forum: Ask for Help (v2)
Topic: Easy way to show A_TrayMenu?
Replies: 8
Views: 562

Re: Easy way to show A_TrayMenu?

So cool. I knew it must be a setting if it worked for some folks and not me. coordMode turned out to do the trick! Thanks to everyone for the help. Hopefully it helps someone else here in the forums too.
by sirksel
16 Jan 2024, 21:48
Forum: Ask for Help (v2)
Topic: Easy way to show A_TrayMenu?
Replies: 8
Views: 562

Re: Easy way to show A_TrayMenu?

Thanks for this. It works like I'd hoped, except it cuts off the right and bottom of the menu. I'm not sure how this works, but isn't X,Y in .Show() intended to be the upper-left corner? This is why I was trying to get the height of the menu, so I could offset for its size. Does this code above disp...
by sirksel
16 Jan 2024, 08:45
Forum: Ask for Help (v2)
Topic: Easy way to show A_TrayMenu?
Replies: 8
Views: 562

Re: Easy way to show A_TrayMenu?

Thanks for your help. Makes sense that it's always at the cursor position, although I hadn't really thought about that. Rather than trying to align specifically with the AHK icon on the task bar, I'm just thinking I'll align the menu at the bottom right-hand corner of the screen, but above the task ...
by sirksel
12 Jan 2024, 09:26
Forum: Ask for Help (v2)
Topic: Easy way to show A_TrayMenu?
Replies: 8
Views: 562

Easy way to show A_TrayMenu?

I'm trying to define a hotkey to show A_TrayMenu (modified though it may be) in its usual position (just above and aligned withe the AHK tray icon). When I use A_TrayMenu.Show(), it winds up at the cursor position. I know I could specify X,Y, but that entails calculating pixels to display in lower R...
by sirksel
29 Dec 2023, 22:55
Forum: Ask for Help (v2)
Topic: Entire Unparsed A_Args? Topic is solved
Replies: 10
Views: 525

Re: Entire Unparsed A_Args? Topic is solved

Seven0528 , this is super cool! Thanks for taking time to do that. Plus, I like the way you used the class and getters and everything. Gives me lots of good ideas for my own library. I will work through the issues you point out in your subsequent message, but this helps a whole lot. Thanks again!
by sirksel
29 Dec 2023, 16:26
Forum: Bug Reports
Topic: [2.1 alpha8] Question re Array.Pop() and unset?
Replies: 4
Views: 453

Re: [2.1 alpha8] Question re Array.Pop() and unset?

It seems to me that pop is expected to be a combination of (1) removing and (2) returning the rightmost element. The removal seems like it happens correctly, whether the element is set or unset. It's the blank return that's odd and undocumented. I think, as I'm remembering now, array item access ret...
by sirksel
29 Dec 2023, 16:08
Forum: Ask for Help (v2)
Topic: Entire Unparsed A_Args? Topic is solved
Replies: 10
Views: 525

Re: Entire Unparsed A_Args? Topic is solved

I learn something new every day. I was assuming the \" final quote thing (for example) was from AHK, but I guess it's just Windows' weak parsing to begin with. I was looking at the docs on __argc, __argv, __wargv and trying to figure out how batch files handle the %* request. Maybe it just removes t...
by sirksel
29 Dec 2023, 09:42
Forum: Ask for Help (v2)
Topic: Entire Unparsed A_Args? Topic is solved
Replies: 10
Views: 525

Re: Entire Unparsed A_Args? Topic is solved

Your 25K post count (vs my pathetic 200) tells me you've probably forgotten more about AHK than I'll ever know. :) Thanks again!
by sirksel
29 Dec 2023, 09:34
Forum: Ask for Help (v2)
Topic: Entire Unparsed A_Args? Topic is solved
Replies: 10
Views: 525

Re: Entire Unparsed A_Args? Topic is solved

I have a caller that sends inconsistenly quoted arguments that may or may not contain spaces. Basically, it requires much more complicated parsing of the script args than AHK does by default. I could just make the caller enclose the whole thing in quotes, but it happens in a lot of places and causes...
by sirksel
29 Dec 2023, 09:11
Forum: Bug Reports
Topic: [2.1 alpha8] Question re Array.Pop() and unset?
Replies: 4
Views: 453

[2.1 alpha8] Question re Array.Pop() and unset?

In the following code: a := [10,,30] b := [20,,40] c := [30,,] d := [,,5] a.Default := 99 a3 := a.Pop(), a2 := a.Pop() b3 := b.Pop(), b2 := b.Pop() MsgBox('' . 'a2 is set: ' IsSet(a2) '`n' ; 1 . 'a2 type: ' type(a2) '`n' ; String . 'a2 val: ' a2 '`n' ; '' . 'b2 is set: ' IsSet(b2) '`n' ; 1 . 'b2 typ...
by sirksel
29 Dec 2023, 07:43
Forum: Ask for Help (v2)
Topic: Entire Unparsed A_Args? Topic is solved
Replies: 10
Views: 525

Entire Unparsed A_Args? Topic is solved

I was trying to find if anyone has found a tested way to get the entire script parameter argument string that was used to run the current script (like %* in batch files). Here are the constraints I have: I can't wrap the script call in a batch file to preprocess things. I need to handle it in AHK. I...
by sirksel
17 Dec 2023, 09:16
Forum: Ask for Help (v2)
Topic: Zero-based array
Replies: 6
Views: 553

Re: Zero-based array

Very nice. This is similar to what I meant by handling the potential negative offsets. The only thing I did slightly differently was that I handled the conversion of negative to positive offsets in my code (which is definitely not necessary, and likely slower). This was mostly due to some other "sli...
by sirksel
08 Dec 2023, 19:31
Forum: Ask for Help (v2)
Topic: Zero-based array
Replies: 6
Views: 553

Re: Zero-based array

Thanks for looking. Glad to know there wasn't an easier way I missed. In answer to your question, it was a set of algorithms for array/string edit distance (e.g. Levenshtein) that involves a [0] init state, and lots of looped [i-1] that might reference that state. I could have added 1 to every refer...
by sirksel
08 Dec 2023, 07:00
Forum: Ask for Help (v2)
Topic: Zero-based array
Replies: 6
Views: 553

Zero-based array

For a particular algorithm I was implementing I needed to use a 0-based array, so I thought it might be interesting to use a custom class with overrides. I first tried overriding just __Item or just Get alone, but it seemed like I needed to override both, as well as the others. Did I forget anything...
by sirksel
17 Nov 2023, 01:19
Forum: Ask for Help (v2)
Topic: Win11 23H2 Send() issue? Topic is solved
Replies: 3
Views: 327

Re: Win11 23H2 Send() issue? Topic is solved

Thanks, guys. Who would have guessed it would be a Notepad thing? I usually don't even usually test with Notepad, but I guess this time I did. Sorry I missed the prior issue in my search. Since you haven't seen it reported with any other application, I'm relieved. I'll just forget about it then, and...
by sirksel
17 Nov 2023, 01:02
Forum: Ask for Help (v2)
Topic: Win11 23H2 Send() issue? Topic is solved
Replies: 3
Views: 327

Win11 23H2 Send() issue? Topic is solved

Is anyone running 23H2 having an issue with Send()? I don't recall ever having this issue before. I'm running v2 alpha7 but no other programs are open, no other scripts are running, and the test script has only one line: f12::send('hello') It sends the first few characters (like "hel" or something) ...
by sirksel
10 Sep 2023, 17:20
Forum: Ask for Help (v2)
Topic: Is this as "elegant" as it gets? Code review, please. Topic is solved
Replies: 3
Views: 433

Re: Is this as "elegant" as it gets? Code review, please. Topic is solved

You can also pass functions as parameters in AHK, which is pretty "elegant" imho. This enables a simple map-over-array function, which calls a function on every item of an array and returns an array of identical length containing the results of those calls: mapf(arr, fnc, prm*) { ;map function over ...

Go to advanced search