View Single Post
02-23-13, 08:01 AM   #2
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Your table is an indexed table; every value is automatically assigned an index number. Any kind of 'contains' function will use either a loop or a search algorithm to find the correct value.

If you set it up like this:

Code:
local myTable = {
    ["Value1"] = true,
    ["Value2"] = true,
    ["Value3"] = true,
}
Then you have a key-value table where your previous values serve as keys and the value is always true, so you can perform a lookup like this:

Code:
if myTable[someVariable] then ...
  Reply With Quote