Skip to content

GetTokenNameByIndex(int)

The GetTokenNameByIndex Lua function returns a string with the keyword based on the index number provided.

Each keyword is described in the Command Syntax and Keywords section.

  • Integer:
    The integer input is the index number for a corresponding keyword. There is no apparent logic to the index number and the keyword.
  • String:
    A string with the full keyword is returned.

- OR -

  • Nil:
    If there is no corresponding keyword, then nil is returned.

If the keyword exists, this example returns the keywords matching the first 443 index numbers:

Copy CodeLua
```
return function()
-- Create a variable to hold the keyword string
local tokenName = ""
-- Print the keywords to the first 443 indexes if possible
for index = 1, 443, 1 do
tokenName = GetTokenNameByIndex(index)
if tokenName ~= nil then
Printf("Token index " .. index .. " = " .. tokenName)
end
end

end