HaveItem to convert to lowerstrings also the tableitem

Feature requests for future versions of Hollywood can be voiced here
Post Reply
Bugala
Posts: 1168
Joined: Sun Feb 14, 2010 7:11 pm

HaveItem to convert to lowerstrings also the tableitem

Post by Bugala »

HaveItem(Table, "AbCd")

automatically converts AbCd into lowercase abcd, which is good, but problem is that it doesn't lowerstring convert tables items.

Therefore if I have tableitem "Abcd", using HaveItem(Table, "AbCd") wont find it, or even worse, searching with HaveItem(Table, "Abcd") wont find item "Abcd" since Haveitem first converts it into lowerstring and then compared "abcd" against "Abcd".

Wish request would be that in next Hollywood version HaveItem would convert all items too into lowercase so that as long as you are looking for right name, it would find it.
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: HaveItem to convert to lowerstrings also the tableitem

Post by airsoftsoftwair »

Bugala wrote: Fri Jan 22, 2021 12:22 pm Wish request would be that in next Hollywood version HaveItem would convert all items too into lowercase so that as long as you are looking for right name, it would find it.
That's not possible because as explained here, table items are case sensitive, so

Code: Select all

t = {}
t["Abcd"] = "Hello"
t["abcd"] = "World"
DebugPrint(t["Abcd"], t["abcd"])
As you can see, "Abcd" and "abcd" are two different items. So it's impossible for HaveItem() to pick the "right" one for you because there is none. The only thing it can do is just always use the lower case one.
Post Reply