grandMA3 User Manual Publication

GetTokenNameByIndex(int)

grandMA3 User Manual » Plugins » Lua Functions - Object-Free API » GetTokenNameByIndex(int)
Version 2.0

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

  • Integer:
    The integer input is the index number for a corresponding keyword. There is no apparent logic to the index number and the keyword.

Return

  • String:
    A string with the full keyword is returned.

- OR -

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

Example

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

Lua
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