Search found 78 matches

by sirksel
24 Jun 2020, 04:19
Forum: Bug Reports
Topic: [a112] from [a109] conversion issue
Replies: 7
Views: 2010

Re: [a112] from [a109] conversion issue

lexikos and swagfag Sorry friends... I pulled my post down (since it was the last) to try to make it shorter , but I didn't realize you were answering at the same time. The original post is below. You are correct, lexikos. It was a test class. =============================== SOLVED. I wasn't trying...
by sirksel
22 Jun 2020, 14:49
Forum: Bug Reports
Topic: [a112] from [a109] conversion issue
Replies: 7
Views: 2010

Re: [a112] from [a109] conversion issue

Helgef I've figured out why, I think, the error exists. The function is also named xl() . If I change the variable name to any other super-global name, it works. I thought this always worked before because the function namespace was separate. I referred to xl to get to the super-global object refer...
by sirksel
22 Jun 2020, 07:49
Forum: Bug Reports
Topic: [a112] from [a109] conversion issue
Replies: 7
Views: 2010

[a112] from [a109] conversion issue

I keep getting an error with the following line, which doesn't really depend on anything. It worked in 109 but not 112. I can figure out the change that's affecting it. xl is a super-global and this appears in a function that refreshes that super-global. try return comobjtype(xl, 'iid') == 'Excel' ?...
by sirksel
21 Jun 2020, 17:44
Forum: AutoHotkey v2 Development
Topic: [wish] "non-simple" parameter defaults and constants, cont'd
Replies: 7
Views: 3834

Re: [wish] "non-simple" parameter defaults and constants, cont'd

Lexikos , this is great. Thanks! I love the idea of null or Nothing . I would especially love it if it were falsey upon evaluation, since missing OR blank/zero is such a common test. Similar to your discussion of Nothing, I currently use two sentinels: na and nl (super-global quasi-constants -- but...
by sirksel
21 Jun 2020, 08:45
Forum: AutoHotkey v2 Development
Topic: [wish] "non-simple" parameter defaults and constants, cont'd
Replies: 7
Views: 3834

Re: [wish] "non-simple" parameter defaults and constants, cont'd

lexikos , thanks for this. Sounds promising! I haven't used the latest version yet (need to update lots of code for the ErrorLevel changes...), but I have a question about unset . I apologize that I haven't tried it yet. For me, I'm thinking it might only get rid of my sentinel structures if it can...
by sirksel
03 Jun 2020, 12:18
Forum: Suggestions on documentation improvements
Topic: For..Until
Replies: 5
Views: 365

Re: For..Until

Right, I get it. I need to learn to read! :) Anyhow, maybe it's because such a construct doesn't exist with for-loops in several other languages I know... so I read right past those three words? I guess I wasn't actually proposing my little array snippet as an example for the docs. If you guys go do...
by sirksel
03 Jun 2020, 06:55
Forum: Suggestions on documentation improvements
Topic: For..Until
Replies: 5
Views: 365

For..Until

I just saw a sentence in the documentation I've never noticed before in a decade of using autohotkey, but apparently has been there since v1: "Until can be used with any Loop or For " (underline added) I always knew I could do Loop..Until, but I somehow never realized I could do this: a := [2,4,6,8,...
by sirksel
03 Jun 2020, 03:45
Forum: AutoHotkey v2 Help
Topic: __New/__Init Questions
Replies: 6
Views: 427

Re: __New/__Init Questions

Got it. This helps a lot. Thanks Helgef!
by sirksel
03 Jun 2020, 02:13
Forum: AutoHotkey v2 Help
Topic: __New/__Init Questions
Replies: 6
Views: 427

Re: __New/__Init Questions

Excellent. Thanks, Helgef. I'm just cleaning up code as I'm transferring it to the latest alpha, so I'm trying fix little issues as I see them. 1. To clarify my question just a bit, there's no reason you'd ever set _x in both places: class test { _x := 0 ;this just slows things down, right? _y := 0 ...
by sirksel
02 Jun 2020, 21:24
Forum: AutoHotkey v2 Help
Topic: __New/__Init Questions
Replies: 6
Views: 427

__New/__Init Questions

1. Class body instance var declaration vs. New() assignments: Is there any reason (aside from documentation) to initialize a (non-accumulating) instance variable in the class body that's going to be assigned anyhow in __New() based on a parameter? 2. __Init: Is there any special functionality that c...
by sirksel
28 May 2020, 17:23
Forum: AutoHotkey v2 Help
Topic: Replacement for ObjRawGet as "Safe" Property Get? Topic is solved
Replies: 3
Views: 476

Re: Replacement for ObjRawGet as "Safe" Property Get? Topic is solved

Good point. My newer .sget(name, default:='') method is really a test of properties in the object or the base(s), while I had been using ObjRawGet for just testing the object itself. I see how your edited code is more closely tied to that original functionality. Thanks!
by sirksel
28 May 2020, 05:46
Forum: AutoHotkey v2 Help
Topic: Replacement for ObjRawGet as "Safe" Property Get? Topic is solved
Replies: 3
Views: 476

Replacement for ObjRawGet as "Safe" Property Get? Topic is solved

The purpose of ObjRawSet and ObjRawGet is unclear - they were used for both properties and associative arrays, but now only operate on properties. I hadn't decided between renaming them, removing them, or something else, so just tagged them as deprecated. Anyone updating (to the latest v2) old code...
by sirksel
24 May 2020, 19:27
Forum: AutoHotkey v2 Help
Topic: fat arrow in class static vars? Topic is solved
Replies: 1
Views: 304

fat arrow in class static vars? Topic is solved

Have I violated a syntax rule here? class fn { ;functions object constants static t1 := (x => x.test1) ;works static t2 := (x => x.test2) ;works ;static t3 := (x => strlen(x)) ;fails silently if you uncomment ;static t4 := ((a,v) => (a v)) ;fails silently if you uncomment } msgbox 'done'
by sirksel
23 May 2020, 01:29
Forum: AutoHotkey v2 Help
Topic: Boxing Strings Topic is solved
Replies: 18
Views: 885

Re: Boxing Strings Topic is solved

What do you mean by meta-classes? I'm confused by the question. I just used the wrong term -- sorry. I meant meta-functions . In other words, @Helgef's first suggestion was using __Get (and likely __Set and __Call ), which might be the quickest for the particular problem I posed. I just wasn't sure...
by sirksel
21 May 2020, 14:20
Forum: AutoHotkey v2 Help
Topic: Boxing Strings Topic is solved
Replies: 18
Views: 885

Re: Boxing Strings Topic is solved

Thanks for the explanations from both of you! Very helpful. I think I'll do something along these lines... either a metafunction, or a separate property/method-copier that copies the same DRY properties/methods from string_ext to "".base in one way but to these "extended string classes" in a differe...
by sirksel
21 May 2020, 06:14
Forum: AutoHotkey v2 Help
Topic: Boxing Strings Topic is solved
Replies: 18
Views: 885

Re: Boxing Strings Topic is solved

Sorry guys. Tried to post from a mobile and didn't do a good job explaining without code snippets. Here's the algorithm about a 2D array (from the documentation) that I thought was particularly nice: class Array2D extends Array { __new(x, y) { this.Length := x * y this.Width := x this.Height := y } ...
by sirksel
21 May 2020, 00:44
Forum: AutoHotkey v2 Help
Topic: Boxing Strings Topic is solved
Replies: 18
Views: 885

Boxing Strings Topic is solved

If one wants to have a specialized __Item for an Array, it's trivial to extend Array and simply refer to the underlying array elements as base[x] without having to explicitly "box" another object. There's a great example in the v2 help file dealing with a custom __Item for a multidimensional array. ...
by sirksel
16 May 2020, 17:01
Forum: AutoHotkey v2 Help
Topic: Creating Iterable class between Map/Array and Object? Topic is solved
Replies: 9
Views: 754

Re: Creating Iterable class between Map/Array and Object? Topic is solved

Thanks, Helgef. I think I've almost got it now. Thanks so much for your patience in explaining. (Hopefully your efforts might also help others who eventually come along to v2 from v1.) So... if we say class poodle extends dog is that equivalent to saying poodle.base := dog or is it like saying poodl...
by sirksel
16 May 2020, 03:44
Forum: AutoHotkey v2 Help
Topic: Creating Iterable class between Map/Array and Object? Topic is solved
Replies: 9
Views: 754

Re: Creating Iterable class between Map/Array and Object? Topic is solved

Thanks for the clarification. Is it different for 0.base or BoundFunc.base ? It seems like 0.base is [/u] the prototype, right? If I were creating a parallel supplementary object model, should the same be true for BoundFunc.base ? To better understand the prototypes, I was experimenting with playing...
by sirksel
15 May 2020, 11:53
Forum: AutoHotkey v2 Help
Topic: Creating Iterable class between Map/Array and Object? Topic is solved
Replies: 9
Views: 754

Re: Creating Iterable class between Map/Array and Object? Topic is solved

Thanks, Helgef. I knew it must be something easy. Still getting used to all the implications of the new object model, but I do like it. Very nice for the separation of data... Thanks again.

Go to advanced search