Cmd(string[, handle])

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » Cmd(string[, handle]) Version 2.2

説明

The Cmd Lua function executes a command in the grandMA3 command line. It is executed in a Lua task - not the Main task (standard typed commands are run in the Main task). It is executed synchronously, and it blocks the Lua task while executing. This means that a bad command has the potential to block the system.

Alternative functions are CmdIndirect() and CmdIndirectWait().

引数

  • string:
    A string with the command to be executed in the command line. Do not add a please or enter to execute the command.
  • handle (オプション):
    A handle to an undo (oops) list. Learn more in the CreateUndo topic.
  • ... (オプション):
    Additional arguments relevant for the command.

戻り値

  • string:
    A string is returned with the execution feedback known from the command line feedback
    • OK:
      Command executed.
    • Syntax Error:
      The command was not executed because of a syntax error.
    • Illegal Command:
      Command not executed because of some illegal command or action.

The returned string does not need to be used.

This example executes the command "ClearAll" in the command line.

Lua
return function()
--Execute the command directly
Cmd("ClearAll")
end