Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API tContains

Last wiki revision 2012-12-27

Returns whether a value is contained in the array portion of the table. exists = tContains(table, value)

  • table : Table - table to search.
  • value : Any - value to find in the array portion of the specified table
  • exists : Flag - 1 if the array portion of the table (sequential integer keys ascending from 1) contains the specified value, nil otherwise.

function tContains(table, item) local index = 1; while table[index] do if ( item == table[index] ) then return 1; end index = index + 1; end return nil; end

lotus = { "pink", "pretty" }; print(tContains( lotus, "yummy" )) -- false

Source

https://warcraft.wiki.gg/wiki/API_tContains · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.