GetTokenNameByIndex(int)
Description
Section titled âDescriptionâ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.
Arguments
Section titled âArgumentsâ- 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.
Example
Section titled âExampleâ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 stringlocal tokenName = ""-- Print the keywords to the first 443 indexes if possiblefor index = 1, 443, 1 do tokenName = GetTokenNameByIndex(index) if tokenName ~= nil then Printf("Token index " .. index .. " = " .. tokenName) endendend