grandMA3 User Manual Publication
ClassExists(string)

grandMA3 User Manual » Plugins » Lua Functions - Object-Free API » ClassExists(string)
Version 2.0

Description

The ClassExists Lua function returns a boolean indicating whether the provided string is a class.

Arguments

  • String:
    A string containing a single word that could be a class.

Return

  • Boolean:
    The function returns a boolean.
    • True:
      The provided word is a class.
    • False:
      The provided input is not a class.

Example

This example asks if the word "Display" is a class and returns proper feedback.

Lua
return function()
-- Store a string with the class name
local className = "Display"
-- Check if the class exists and then provide proper feedback
if ClassExists(className) then
Printf("The class '%s' exists", className)
else
Printf("The class '%s' does not exists", className)
end
end