lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Lua:
> mylist = {"a", "b", "c"};
> a = "a"
> if mylist[a] ~= nil then
>    print "a is in the list"
> end

Did you try it?  In Lua the table

    {"a", "b", "c"}

is the same as

    {[1] = "a", [2] = "b", [3] = "c"}

which only has numeric keys, so there is no key "a".

--
Wim