Search found 4479 matches

by Helgef
17 Jan 2021, 04:01
Forum: Scripts and Functions
Topic: [class][v1/v2] hashTable - an associative array
Replies: 8
Views: 1920

Re: [class][v1/v2] hashTable - an associative array

There is no support for that. I have no plans to work on this.

You can simulate multi dimensions if you can use one unique string delimiter, eg ht[key1 . "@" . key2]

Thanks for the feedback, cheers.
by Helgef
17 Jan 2021, 03:48
Forum: AutoHotkey v2 Help
Topic: Why does param expression increment ref count by 2?
Replies: 5
Views: 162

Re: Why does param expression increment ref count by 2?

Reference-Counting wrote:Temporary references returned by functions, methods or operators within an expression are released after evaluation of that expression has completed or been aborted.
One reference for the expression, and one reference for the function parameter.

Cheers.
by Helgef
09 Jan 2021, 10:04
Forum: AutoHotkey v2 Help
Topic: Hot Key for Ctrl-A Ctrl-C
Replies: 2
Views: 95

Re: Hot Key for Ctrl-A Ctrl-C

in v2 syntax TheDewd's example would look like,

Code: Select all

#SingleInstance Force

Ctrl & Q:: {
	Send '^a' ; Ctrl + A
	Sleep 150
	Send '^c' ; Ctrl + C
}
It is usually recommended to use ^q:: over ctrl & q::, in both v1 and v2.

Cheers.
by Helgef
09 Jan 2021, 09:53
Forum: Wish List
Topic: Disable Auto-Repeat?
Replies: 1
Views: 140

Re: Disable Auto-Repeat?

by Helgef
09 Jan 2021, 09:50
Forum: Wish List
Topic: Constant Variables
Replies: 2
Views: 160

Re: Constant Variables

Any capacity to add variables that cannot change values.
Yes,
Classes wrote:When the script is loaded, this constructs a Class object and stores it in a super-global constant (read-only variable) with the name ClassName.
But not specifically what you ask for.

Cheers.
by Helgef
09 Jan 2021, 09:45
Forum: Wish List
Topic: Allow built-in variables as default function parameters
Replies: 22
Views: 799

Re: Allow built-in variables as default function parameters

If parameters could have arbitrary expressions as their default value, I think it would be more useful if the expression was evaluated in function scope rather than call site. Consider, box(x, y := x) For the particular case of A_LineNumber , you can use the Exception () function, If What is omitted...
by Helgef
09 Jan 2021, 09:37
Forum: AutoHotkey v2 Help
Topic: How to port pointer arithmethics?
Replies: 3
Views: 114

Re: How to port pointer arithmethics?

yes.

Cheers.
by Helgef
06 Jan 2021, 05:31
Forum: AutoHotkey v2 Help
Topic: How to port pointer arithmethics?
Replies: 3
Views: 114

Re: How to port pointer arithmethics?

Hello and happy new year, see :arrow: buffer object ptr property.

Cheers.
by Helgef
04 Jan 2021, 10:40
Forum: AutoHotkey v2 Help
Topic: InputHook - KeyOpt I option
Replies: 3
Views: 162

Re: InputHook - KeyOpt I option

I: Ignore text. Any text normally produced by this key is ignored, and the key is treated as a non-text key (see VisibleNonText). Has no effect if the key normally does not produce text. The key can produce different text depending on modifier state, what you observe is the expected behaviour. Chee...
by Helgef
04 Jan 2021, 10:27
Forum: AutoHotkey v2 Help
Topic: Exclamation will not print out.
Replies: 3
Views: 101

Re: Exclamation will not print out.

You can also use the :arrow: text mode options, eg,

Code: Select all

:T:abc:: Now is the time!
Cheers :champagne: :fireworks:
by Helgef
04 Jan 2021, 10:22
Forum: AutoHotkey v2 Help
Topic: Reference to Map element?
Replies: 3
Views: 148

Re: Reference to Map element?

Is there any way to perform something like above without having to do the map->string->table lookup twice No. Believe it or not, I came up with a simple solution No you didn't, at least not if you want to avoid the looking-up stuff , i.e., in if( element.Value * element.Value > 30 ) element.Value :...
by Helgef
04 Jan 2021, 10:14
Forum: AutoHotkey v2 Help
Topic: String != String case insensitive?
Replies: 9
Views: 183

Re: String != String case insensitive?

I think most experienced programmers would assume == and != are opposite logical operators.
Programmers of any amount of experience shouldn't assume anything, but read the documentation.

Cheers :champagne: :fireworks:
by Helgef
29 Nov 2020, 09:30
Forum: AutoHotkey v2 Development
Topic: [Wish] longer continuation sections/lines still
Replies: 10
Views: 3117

Re: [Wish] longer continuation sections/lines still

SimpleHeap::Malloc is used for a lot of things other than continuation sections. so this limit will also apply to other things too. For example, the number of tokens in an expression. It should probably be fixed at some point.

Cheers.
by Helgef
29 Nov 2020, 09:07
Forum: AutoHotkey v2 Help
Topic: how to reference class/subclass object inside instance method? Topic is solved
Replies: 11
Views: 710

Re: how to reference class/subclass object inside instance method? Topic is solved

does that prevent instances themselves from being destroyed? no it does not. I don't get your interpretation though. Your code, clsobj => %this.__class% ;class object doesn't create any circular (or any) references. i dont get what ur gripes with %this.__Class% It relies on a super global variable ...
by Helgef
29 Nov 2020, 08:50
Forum: AutoHotkey v2 Help
Topic: #DllLoad proper usage with utility class
Replies: 6
Views: 310

Re: #DllLoad proper usage with utility class

You can only load a dll once, if I'm not mistaken (disregarding copies). Using #dllload or LoadLibrary() on the same dll multiple times will not create new "instances" of it. you want the consumer to be able to pass the path to the Dll. Is the consumer a programmer using the class or a user of a pro...
by Helgef
31 Oct 2020, 07:17
Forum: AutoHotkey v2 Help
Topic: Assigning ahk_exe with variable Topic is solved
Replies: 4
Views: 285

Re: Assigning ahk_exe with variable Topic is solved

Instead of the fat-arrow example, it is often better to use a boundfunc. Eg, SetTimer func('checkwin').bind(AhkName), 1000. Because the fat-arrow still depends on the global variable AhkName, the boundfounc binds the value and doesn't depend on the variable after it has been created.
by Helgef
31 Oct 2020, 07:10
Forum: AutoHotkey v2 Help
Topic: how to reference class/subclass object inside instance method? Topic is solved
Replies: 11
Views: 710

Re: how to reference class/subclass object inside instance method? Topic is solved

class => %this.__Class% is ofc better than using %this.__Class% directly, it is still worse than my proposal though. Imo, a class property should be built-in. I think lexikos mentioned somewhere that he had considered it, or perhaps it was available in objects.ahk.

Cheers.
by Helgef
24 Oct 2020, 03:03
Forum: AutoHotkey v2 Development
Topic: Key names without the modifiers?
Replies: 2
Views: 511

Re: Key names without the modifiers?

I don't think it makes sense to add this as a parameter. It would make more sense to change the current parameter to be the hotkey object itself, which could have the desired information accessible through a property. I don't think that is a priority though.

Cheers.
by Helgef
24 Oct 2020, 02:45
Forum: Scripts and Functions
Topic: [class][v1/v2] hashTable - an associative array
Replies: 8
Views: 1920

Re: [class][v1/v2] hashTable - an associative array

Does it work faster than adding AHK objects?
You can't add objects to this hashtable. It only stores strings if ircc.

Cheers.

Go to advanced search