Search found 3238 matches

by Helgef
Yesterday, 10:48
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 56
Views: 517

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
Yesterday, 10:41
Forum: Ask For Help
Topic: [AHK v2] Hotkey command break circular reference? Topic is solved
Replies: 3
Views: 47

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
Yesterday, 07:01
Forum: Ask For Help
Topic: [AHK v2] Hotkey command break circular reference? Topic is solved
Replies: 3
Views: 47

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
Yesterday, 06:40
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 56
Views: 517

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
Yesterday, 06:34
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 56
Views: 517

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
Yesterday, 06:29
Forum: Forum Issues
Topic: Codebox theme
Replies: 15
Views: 255

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
Yesterday, 03:30
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 56
Views: 517

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: 56
Views: 517

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: 7
Views: 134

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: 75

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

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: 7
Views: 134

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: 56
Views: 517

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: 56
Views: 517

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.
by Helgef
15 Nov 2018, 04:09
Forum: Ask For Help
Topic: How to write this shorter?
Replies: 8
Views: 147

Re: How to write this shorter?

Very good kczx3 :thumbup:

Cheers.
by Helgef
15 Nov 2018, 04:08
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 56
Views: 517

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

ObjGetBase(Object) and ObjSetBase(Object, BaseObject) used to return an empty string when they failed. When? An exception is thrown if Object is of an incorrect type. src: ObjGetBase It is clearly documented behaviour. The code above confirms that the function object Func("Hello") is indeed an obje...
by Helgef
10 Nov 2018, 11:35
Forum: Ask For Help
Topic: How to write this shorter?
Replies: 8
Views: 147

Re: How to write this shorter?

An other approach would be to use properties for your object, consider this example, class commandTypeObj { a { set { this._b := this._c := !value return this._a := value } get { return this._a } } b { set { this._a := this._c := !value return this._b := value } get { return this._b } } c { set { th...
by Helgef
10 Nov 2018, 07:46
Forum: Ask For Help
Topic: How to write this shorter?
Replies: 8
Views: 147

Re: How to write this shorter?

You only copy reference, if that is what worries you. You can do, f(it) { it.is_multiline_rr && it.is_r := false } f(commandTypeObj) to avoid extra references / variables. in v2 you can do, f(it) => it.is_multiline_rr && it.is_r := false. f commandTypeObj and f can be nested in an other function too...
by Helgef
10 Nov 2018, 07:23
Forum: Ask For Help
Topic: How to write this shorter?
Replies: 8
Views: 147

Re: How to write this shorter?

Another, (it := commandTypeObj).is_multiline_rr && it.is_r := false.

Cheers.

Go to advanced search