HaveItem() - maybe needs more explanation in manual

Report any Hollywood bugs here

HaveItem() - maybe needs more explanation in manual

Postby peceha » Sat Sep 23, 2017 1:32 pm

Hi
please check this out:
Code: Select all
t={["One"]=1}
DebugPrint(HaveItem(t,"One"))

it prints 0 !! - but it should be 1
The thing is, HaveItem() probably converts its second argument to lowercase and cannot find a match if there is a match (and opposite):
Code: Select all
t={["one"]=1}
DebugPrint(HaveItem(t,"One"))

prints 1

The same apply to the other constructor of the table (t={one=1}) - in this case HaveItem(t,"one") and HaveItem(t,"One") will show 1

Maybe there should be a remark in docs ? It took me whole day to find out where the problem is.

RawGet() works correctly here.
peceha
 
Posts: 111
Joined: Tue Dec 13, 2016 9:39 am
Location: Poland

Re: HaveItem() - maybe needs more explanation in manual

Postby airsoftsoftwair » Wed Sep 27, 2017 7:38 pm

Ok, added a little note.
User avatar
airsoftsoftwair
 
Posts: 2343
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany


Return to Hollywood bugs

Who is online

Users browsing this forum: No registered users and 2 guests

cron