[V 1.1] Object.Delete(Key) doesn't work in some cases Topic is solved

Report problems with documented functionality
User avatar
oldbrother
Posts: 273
Joined: 23 Oct 2013, 05:08

[V 1.1] Object.Delete(Key) doesn't work in some cases

23 Mar 2024, 13:07

When "Delete" is key of an object, Delete(Key) stops working. Some other key words could have similar issues, but I'm not sure. Please see the details in this thread:

viewtopic.php?f=76&t=127710&p=564519#p564519

I hope this can be fixed!

Code: Select all

#Requires AutoHotkey v1

words := {"AAA": 1, "Delete": 2, "Add": 3, "Hello": 4}
NewWord := "AAA"

words[NewWord] := "5" ; Works
MsgBox % words[NewWord]

words.Delete(NewWord) ; Doesn't work
MsgBox % words[NewWord]
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: [V 1.1] Object.Delete(Key) doesn't work in some cases  Topic is solved

23 Mar 2024, 20:32

This is by design. words.Delete(NewWord) will try to call the function named "2". One of many design flaws of v1 fixed by v2. (You are effectively doing the same as words.Delete := 2, which would also prevent the method from being called in v2. But in v2, an error would be thrown.)

Also, I see you are aware of End of Life: v1.1. The writing has been on the wall for years. I personally have no reason to reconsider, even if someone finds a bug. Someone else can fix their own fork of v1, if they want.

I am locking this topic since it is not a bug and you already have a topic in Ask for Help.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 67 guests