Hello,
This is not necessarily a bug-- I am not certain-- but something unexpected. If
Delete is a key in your array, then
word.Delete(NewWord) refers to your array property or element rather than referring to the Delete method.
Code: Select all
#Requires AutoHotkey v1
NewWord := "AAA"
word := {"AAA": 1, "Delete": "NOT A METHOD"}
MsgBox % word[NewWord]
word.Delete(NewWord)
MsgBox % word.Delete
MsgBox % word[NewWord]
For all types of objects, the notation
Object.LiteralKey can be used to access a property, array element or method, where LiteralKey is an identifier or integer and Object is any expression. Identifiers are unquoted strings which may consist of alphanumeric characters, underscore and, in [v1.1.09+], non-ASCII characters.
Source: Objects - Definition & Usage | AutoHotkey v1
Perhaps AHK should use the presence of parentheses to know that the statement uses a method.
I think that this is a bug; it appears that when the array contains a key called "Delete", the Delete method can no longer be used.