Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/gamestates2/data/lua/Tools.lua @ 6671

Last change on this file since 6671 was 6671, checked in by rgrieder, 14 years ago

Added Tools.lua and moved 'find' in InitialiseGUI.lua to 'table.findIndex' in Tools.lua.

  • Property svn:eol-style set to native
File size: 306 bytes
Line 
1function handleDefArg(argument, defaultValue)
2    if argument == nil then
3        return defaultValue
4    else
5        return argument
6    end
7end
8
9function table.findIndex(table, value)
10    for i, v in ipairs(table) do
11        if v == value then
12            return i
13        end
14    end
15    return 0
16end
17
Note: See TracBrowser for help on using the repository browser.