Search found 3929 matches

by Helgef
Yesterday, 09:56
Forum: Ask For Help
Topic: What is a byte array and how to call this dll file?
Replies: 10
Views: 543

Re: What is a byte array and how to call this dll file?

DllCall("ocr.dll\init") I assume this is supposed to do some kind of initialisation for the dll and is required to be called before any other functions in the library are used. If that is the case, see this :arrow: weird script crash if LoadLibrary isnt used . More guessing, I find it unlikely that...
by Helgef
Yesterday, 04:58
Forum: Ask For Help
Topic: dynamic function calls silently fail
Replies: 3
Views: 199

Re: dynamic function calls silently fail

Dynamic function calls silently fail in AHK v1. [...] Would this be reasonably straightforward to fix in AHK v1? Again, the documentation, If the function does not exist, the default base object's __Call meta-function is invoked instead. So, for example, f(n) { static f := f.base.__call := "f" thro...
by Helgef
21 Oct 2019, 10:19
Forum: Ask For Help
Topic: dynamic function calls silently fail
Replies: 3
Views: 199

Re: dynamic function calls silently fail

jeeswg wrote:
21 Oct 2019, 08:53
Has anyone noticed this
Try the documentation,
If the function cannot be called due to one of the reasons below, the evaluation of the expression containing the call stops silently and prematurely, which may lead to inconsistent results:

Calling a nonexistent function
Cheers.
by Helgef
21 Oct 2019, 07:15
Forum: Ask For Help
Topic: Cursor - Rectangle
Replies: 16
Views: 706

Re: Cursor - Rectangle

Coming from a background writing in C I never write using "And", "Or", "Not". So I don't have any issues reading or writing with "&&" FYI, :arrow: Alternative operators and tokens ;) teadrinker and Hellbent , nice scipts 8-) Cheers. Edit : Oh god no lol. [...] :lol: :thumbup: Cheers.
by Helgef
19 Oct 2019, 02:59
Forum: Ask For Help
Topic: Unable call "class variable" from "variable"
Replies: 2
Views: 142

Re: Unable call "class variable" from "variable"

use obj[ expr ] := val. Eg,

Code: Select all

obj := {}
temp := "a"
obj[ temp ] := 123
msgbox % obj["a"] ; or obj.a
Cheers.
by Helgef
10 Oct 2019, 02:16
Forum: Bug Reports
Topic: Single line hotkeys
Replies: 5
Views: 356

Re: Single line hotkeys

The behaviour is undefined. I'm pretty sure this is known though.

Cheers.

Edit, perhaps I was mistaken.
by Helgef
07 Oct 2019, 11:05
Forum: AutoHotkey v2 Help
Topic: Return value of __New() and alternative way of instantiating a class object
Replies: 8
Views: 607

Re: Return value of __New() and alternative way of instantiating a class object

if I change __New() to static New() in my first example, .Value is unassigned. When you call a static method, the this parameter refers to the class itself (or a subclass). So in your case, the .Value would be assigned to the Num class. You should implement you own new() method, verify the input an...
by Helgef
06 Oct 2019, 12:39
Forum: AutoHotkey v2 Help
Topic: Return value of __New() and alternative way of instantiating a class object
Replies: 8
Views: 607

Re: Return value of __New() and alternative way of instantiating a class object

do I have to use static New()?.
yes, this has several benefits over the v1 behaviour.
by Helgef
06 Oct 2019, 01:43
Forum: Ask For Help
Topic: SendInput getting called twice (on down and up) instead of just once Topic is solved
Replies: 4
Views: 285

Re: SendInput getting called twice (on down and up) instead of just once Topic is solved

The $ prefix forces the keyboard hook to be used to implement this hotkey [...]
The $ prefix has no effect for mouse hotkeys, since they always use the mouse hook.
by Helgef
06 Oct 2019, 00:07
Forum: AutoHotkey v2 Help
Topic: Return value of __New() and alternative way of instantiating a class object
Replies: 8
Views: 607

Re: Return value of __New() and alternative way of instantiating a class object

1) see :arrow: Class.new.
2) I don't understand the question, the answer might be the same as 1) though.

Cheers.
by Helgef
05 Oct 2019, 04:08
Forum: AutoHotkey v2 Help
Topic: [a104] are builtin classes protected against accidental overwriting? Topic is solved
Replies: 23
Views: 1411

Re: [a104] are builtin classes protected against accidental overwriting? Topic is solved

I already said I didn't get your point. To your point. Yes, I knew that: in AHK v2, 'is' supports object and byref. That wasn't my point, the result is true if Value is an object derived from Type, directly or indirectly . Do you want these to be prohibited variable names: Array/Class/Map/Object, Gu...
by Helgef
04 Oct 2019, 13:07
Forum: AutoHotkey v2 Help
Topic: [a104] are builtin classes protected against accidental overwriting? Topic is solved
Replies: 23
Views: 1411

Re: [a104] are builtin classes protected against accidental overwriting? Topic is solved

I was perfectly happy with oArray.__Class = "Array" or Type(oArray) = "Array", I don't see the need for the check to be done against a *variable*. So I guess you didn't read the documentation on :arrow: is . If Type is an object, the result is true if Value is an object derived from Type, directly ...
by Helgef
04 Oct 2019, 11:50
Forum: AutoHotkey v2 Help
Topic: fat-arrows and methods Topic is solved
Replies: 10
Views: 602

Re: fat-arrows and methods Topic is solved

I've got the timer to work. It doesn't seem like it. SecondCounter.DefineProp("count", {get : (this) => 0, set : (this) => this}) Makes no sense. You are also not binding anything to the timer function, what do you expect this will be? EDIT: I don't even begin to figire out how to instansiate a pro...
by Helgef
04 Oct 2019, 10:58
Forum: AutoHotkey v2 Development
Topic: Changes to %fn%(), fn.call() or func('fn') syntax?
Replies: 32
Views: 2209

Re: Changes to %fn%(), fn.call() or func('fn') syntax?

I'm not sure we are on topic now. I guess something similar could look like this,

Code: Select all

namespace.s()

class namespace {
   class s {
      static call() {
         MsgBox A_ThisFunc
      }
   }
   static __Call(name, terms) {
		return %(this.%name%)%(terms*)
   }
}
by Helgef
04 Oct 2019, 10:35
Forum: AutoHotkey v2 Development
Topic: Changes to %fn%(), fn.call() or func('fn') syntax?
Replies: 32
Views: 2209

Re: Changes to %fn%(), fn.call() or func('fn') syntax?

Code: Select all

class f {
	static call() {
		msgbox a_thisfunc
	}
}
%f%()
by Helgef
04 Oct 2019, 10:32
Forum: AutoHotkey v2 Development
Topic: Changes to %fn%(), fn.call() or func('fn') syntax?
Replies: 32
Views: 2209

Re: Changes to %fn%(), fn.call() or func('fn') syntax?

No, see User-Defined. You can use the static keyword if you like.
by Helgef
04 Oct 2019, 08:33
Forum: AutoHotkey v2 Help
Topic: fat-arrows and methods Topic is solved
Replies: 10
Views: 602

Re: fat-arrows and methods Topic is solved

Perhaps literal object definitions could allow definitions of method and dynamic properties, so an alternative to class SecondCounter { interval := 1000 timer := () => ToolTip(++this.count) Start(n := 0) => ((this.count := n), SetTimer(this.timer, this.interval), ToolTip("Counter started")) Stop() =...
by Helgef
04 Oct 2019, 08:10
Forum: AutoHotkey v2 Development
Topic: Changes to %fn%(), fn.call() or func('fn') syntax?
Replies: 32
Views: 2209

Re: Changes to %fn%(), fn.call() or func('fn') syntax?

Hi @sirksel, thanks for sharing your ideas.

A small correction,
Helgef, I know you and Lexikos and others know the code base inside and out
Cheers.
by Helgef
04 Oct 2019, 06:45
Forum: AutoHotkey v2 Development
Topic: Changes to %fn%(), fn.call() or func('fn') syntax?
Replies: 32
Views: 2209

Re: Changes to %fn%(), fn.call() or func('fn') syntax?

I'm only suggesting that AHK might want to allow for a level of agnosticism (parallel syntax) between explicit and derived functions when calling and referencing them -- which then unlocks a lot more possibilities and much clearer and more readable code for those that choose to use AHK for function...
by Helgef
04 Oct 2019, 03:42
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 100
Views: 13946

Re: your personal AutoHotkey style guide

Loop { i += 1 MsgBox,,, % i } Until i = 5 While i < 5 { i += 1 MsgBox,,, % i } These aren't equivalent. The expression is evaluated once after each iteration The expression is evaluated once before each iteration. - I find that using 'Loop' (indefinite) or 'Loop count', with an if-statement to caus...

Go to advanced search