Page 1 of 1

[BUG] AutoHotkey_2.0-a088-338ed55 Object

Posted: 01 Feb 2018, 06:51
by _3D_
This effect not present in AutoHotkey_2.0-a081-cad307c.

Code: Select all

name:= "c:\path\com1_123.txt"
if RegExMatch(name, "i)COM\d+", port) {	; <<< create object port
	msgBox(isObject(port))				; <<< check is object
	port.dest:= "" 						; <<< unknown property or method
}
And the result:

Code: Select all

---------------------------
[BUG] Object.ahk
---------------------------
Error:  Unknown property or method.

Specifically: dest

	Line#
	001: name := "c:\path\com1_123.txt"
	002: if RegExMatch(name, "i)COM\d+", port)
	002: {
	003: msgBox(isObject(port))
--->	004: port.dest:= ""
	005: }
	006: Exit
	007: Exit
	007: Exit

The current thread will exit.
---------------------------
OK   
---------------------------
Next code work:

Code: Select all

port:= {}
msgBox(isObject(port))	; <<< check is object
port.dest:= "" 			; <<< work

Re: [BUG] AutoHotkey_2.0-a088-338ed55 Object  Topic is solved

Posted: 01 Feb 2018, 07:08
by Helgef
RegExMatch objects cannot be written to. You get the error now ( :thumbup: ), but it didn't work earlier, not in v1 and not in v2.

Code: Select all

; v1
regexmatch("a","O)a",m)
msgbox % m.0
m.0 := "b"
msgbox % m.0
Note,

Code: Select all

regExMatch("", "", m)
msgbox type(m) "`n" type({})