Search found 8 matches

by formicant
30 Jan 2018, 13:03
Forum: Scripts and Functions
Topic: [CLASS] Lyt - Keyboard layout (language) operation
Replies: 27
Views: 3586

Re: [CLASS] Lyt - Keyboard layout (language) operation

Great! Thanks.
(Please note that the method names in the examples differ from the ones in the class. E.g. GetLng ~ GetLocaleName.)

BTW, what is the best way to monitor the layout changing?
by formicant
26 Jan 2018, 10:11
Forum: AutoHotkey v2 Development
Topic: ||= and &&= operators
Replies: 6
Views: 361

Re: ||= and &&= operators

a := a && b Reads well when the first argument is short. But, for example, in the actual code I’m writing, I had to write: this.Layouts[layout.Level] := this.Layouts[layout.Level] || { } and this.Combinations[combinator][length] := this.Combinations[combinator][length] || new Dictionary Isn...
by formicant
25 Jan 2018, 09:45
Forum: AutoHotkey v2 Development
Topic: ||= and &&= operators
Replies: 6
Views: 361

Re: ||= and &&= operators

What would &&= do? :think: Obviously,  a &&= b  should be equivalent to  a := a && b . E.g. totalSuccess := true for index, item in items { itemSuccess := Process(item) totalSuccess &&= itemSuccess } MsgBox(totalSuccess ? "All items processed successfully" ...
by formicant
25 Jan 2018, 04:29
Forum: AutoHotkey v2 Development
Topic: ||= and &&= operators
Replies: 6
Views: 361

Re: ||= and &&= operators

(…or should I post this to the Wish List section?)
by formicant
24 Jan 2018, 13:15
Forum: AutoHotkey v2 Development
Topic: ||= and &&= operators
Replies: 6
Views: 361

||= and &&= operators

A use case: We don’t know if the object exists and want to initialize it if not. In 1.1, we have to write: if(not objectWhoseExistenceIsQuestionable) objectWhoseExistenceIsQuestionable := initialValue In 2.0a, we can also write: objectWhoseExistenceIsQuestionable := objectWhoseExistenceIsQuestionabl...
by formicant
22 Jan 2018, 22:40
Forum: AutoHotkey v2 Development
Topic: Object declaration syntax Topic is solved
Replies: 20
Views: 1160

Re: Object declaration syntax Topic is solved

Be aware that there is currently a limit of 512 tokens per expression, where [, ], {, }, "item1", key1, : and , each count as one token. When you create large data structures with a single object literal, it is more likely you will encounter this limit. Yes, I’ve already encountered this,...
by formicant
21 Jan 2018, 23:09
Forum: AutoHotkey v2 Development
Topic: Object declaration syntax Topic is solved
Replies: 20
Views: 1160

Re: Object declaration syntax Topic is solved

GeekDude wrote:For v2 you may have to specify the Quotes option after LTrim Join.

Oh thanks!
I tried continuation sections but haven’t come to the idea of LTrim Join Quotes combination.

Anyway, wouldn’t it be more convenient to make all { } behave like a continuation section?
by formicant
21 Jan 2018, 21:48
Forum: AutoHotkey v2 Development
Topic: Object declaration syntax Topic is solved
Replies: 20
Views: 1160

Object declaration syntax Topic is solved

Currently, both in AHK 1.1 and 2.0-a, one can declare objects like this: singleLineArray := [ "item1", "item2", "item3" ] singleLineObject := { key1: "value1", key2: "value2", key3: "value3" } multiLineArray := [ "item1" , "i...

Go to advanced search