Search found 3303 matches

by Helgef
21 Nov 2018, 03:59
Forum: Scripts and Functions
Topic: [Class] WinHook
Replies: 17
Views: 831

Re: [Class] WinHook

Well done :thumbup:. Some notes, WinHook.Shell.Message doesn't consider what is returned from the user's function, see What the Function Should Return . If the function returns a non-zero integer, that should probably be returned directly. In WinHook.Event.Add , you only need to call registercallbac...
by Helgef
20 Nov 2018, 03:59
Forum: Scripts and Functions
Topic: [AHK v2] log4ahk - logging for AutoHotkey
Replies: 1
Views: 180

Re: [AHK v2] log4ahk - logging for AutoHotkey

Nice, thanks for sharing. Neat documentation :thumbup:.

Cheers.
by Helgef
19 Nov 2018, 12:49
Forum: Scripts and Functions
Topic: Detecting traces of the default base object
Replies: 4
Views: 204

Re: Detecting traces of the default base object

Hello guest3456 :wave:
I updated it, it is now untested ;) .
Cheers
by Helgef
19 Nov 2018, 12:33
Forum: Scripts and Functions
Topic: Detecting traces of the default base object
Replies: 4
Views: 204

Re: Detecting traces of the default base object

The default base may be accessed by using .base with any non-object value; for instance, "".base

Code: Select all

dbo := 1.base ; here it is, do what you like with it
dbo.push(1,2,3)
msgbox % isobject(dbo) "`n" dbo.count()
Cheers.
by Helgef
18 Nov 2018, 09:44
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 1734

Re: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

No this is AutoHotkey, so the comma operator has the least precedence. Indeed this is AutoHotkey, and in AutoHotkey the comma ( , ) in a parameter list isn't the comma operator but just a symbol separating the parameters. In autohotkey you are lucky that your mistake of mistaking the comma in a par...
by Helgef
17 Nov 2018, 10:48
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 1734

Re: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

Command Syntax has been removed in v2. According to my understanding of the changes, that is misleading. You understand it wrong then. Command syntax is not simply omitting () , as I noted above, hence, calling it command syntax is what is actually misleading. Consider the (perfectly reasonable) li...
by Helgef
17 Nov 2018, 10:41
Forum: Ask For Help
Topic: [AHK v2] Hotkey command break circular reference? Topic is solved
Replies: 3
Views: 101

Re: [AHK v2] Hotkey command break circular reference? Topic is solved

As a side note, to actually free the object in your original code, you need to replace the hotkey, turning it off is not sufficent. Example, e::Hotkey("q", ()=>, "Off"), myHk := "" ; calls dtor. Edit: As far as I can tell, there is no documented way to release the object.
by Helgef
17 Nov 2018, 07:01
Forum: Ask For Help
Topic: [AHK v2] Hotkey command break circular reference? Topic is solved
Replies: 3
Views: 101

Re: [AHK v2] Hotkey command break circular reference? Topic is solved

Hotkey(this.hkName, () => this.doHotkey(fn)) ; im assuming this creates some unreleased references Yes, because in () => this.doHotkey(fn) , this is a free variable. You can do Hotkey(this.hkName, this.doHotkey.bind('', fn)) . But then this is not available in doHotkey() , it doesn't matter in your...
by Helgef
17 Nov 2018, 06:40
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 1734

Re: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

By the way, command syntax, as known from v1 is very different from function calls without () , there is no inital comma and only expressions for the parameters, no literal text or forced expressions. Also, methods can be called this way, eg, obj.m par* , there is no such syntax in v1. I'm sure you ...
by Helgef
17 Nov 2018, 06:34
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 1734

Re: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

Not sure why the function still has to be the first word in a line.

Code: Select all

z := x -y
is substraction, it cannot be interpreted as x(-y), as an example.
by Helgef
17 Nov 2018, 06:29
Forum: Forum Issues
Topic: Codebox theme
Replies: 18
Views: 742

Re: Codebox theme

Thank you very much for your efforts joedf . Would it be possible to remove the blue border on the left side of the code box and move the zero indentation level more to the left, about where the blue line starts now perhaps. Something like this, codebox.png where the bottom most code box is my sugge...
by Helgef
17 Nov 2018, 03:30
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 1734

Re: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

V2 doesn't have commands as v1, you can omit the parentheses when you call a function or method at the beginning of a line, and discard the return value.

Sharing variable and function namespace is highly unsuitable for ahk. If names where case sensitive it might be acceptable.

Cheers.
by Helgef
16 Nov 2018, 12:36
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 1734

Re: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

One AutoHotkey function, IsObject(Value), says that function objects are objects and another, ObjGetBase(Object), says that they are not (unless they are user-defined). Function objects are objects, the second function tells you it is the wrong type of object. There is no contradiction. That does n...
by Helgef
16 Nov 2018, 12:20
Forum: Ask For Help
Topic: [DllCall / NumGet] How to read the value of a pointer to pointer?
Replies: 9
Views: 291

Re: [DllCall / NumGet] How to read the value of a pointer to pointer?

I see that there was not really an answer to the OPs question. There are indeed two pointers involved here. The first pointer is handled by AHK, here: A_PtrSize ? "UPtr*" : "uint*", ppvBits , this passes the address to a location which can hold an "uptr" sized value, the dll function CreateDIBSectio...
by Helgef
16 Nov 2018, 03:18
Forum: AutoHotkey v2 Development
Topic: [a100] fat arrow modifying dynamic var in outer scope Topic is solved
Replies: 3
Views: 249

Re: [a100] fat arrow modifying byref var in outer scope Topic is solved

nested functions wrote:Dynamic variable references inside a nested function can resolve to variables from the outer function only if the nested function (or one of its own nested functions) also contains a non-dynamic reference to the variable.
Byref or not doesn't matter.
by Helgef
15 Nov 2018, 18:26
Forum: Ask For Help
Topic: [DllCall / NumGet] How to read the value of a pointer to pointer?
Replies: 9
Views: 291

Re: [DllCall / NumGet] How to read the value of a pointer to pointer?

var := 123 MsgBox % ptr_var := &var ; prints something resembling an address MsgBox % NumGet(ptr_var, 0, "Int") ; prints something else MsgBox % NumGet(ptr_var+0, 0, "Int") ; prints something else entirely Please see, var := 123 ptr_var := &var ; ptr_var stores the address of var as a string, simil...
by Helgef
15 Nov 2018, 04:40
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 1734

Re: Regression In ObjGetBase(Object) and ObjSetBase(Object, BaseObject)

Indeed, the undesirable behavior is documented. I never said it was not. You posted in bug reports, so you suggest there is a problem (as in not working) with documented behaviour. There clearly isn't, you need to post in the wish list or ask for help. If you pay close attention you can see that th...
by Helgef
15 Nov 2018, 04:18
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 1734

Re: Regression In ObjGetBase(Object) and ObjSetBase(Object, BaseObject)

This is about knowing whether a type can be made to work with an operation at all, and how.
v1,

Code: Select all

can_set_base(value){
	return objgetcapacity(value) != ""
}
:cry:

Cheers.

Go to advanced search