Author Topic: Treating ExecuteCommand() from an inline function as part of a command chain  (Read 1850 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
When a command is executed using "ExecuteCommand()" from an inline function, it appears it is not considered part of the execution chain of the command the inline function is running from:

When a variable is command chain-scoped using the "~~" prefix(either using an action in the command, or a function in the inline function), the executed command will not have access to that variable(the value will be "Not Set").


Also, when using the "ExecuteCommand()" function, if the "Allow other commands to execute while this one is running" option is unchecked for the command that contains that inline function(and the command is still running, which will always happen if the inline function is run synchronously, or if the command has not finished executing otherwise), execution of the target command will be cancelled.

When executing another command using the "Execute Another Command" action, even when using the "Execute by name (Advanced)" option, that command will execute even with the "Allow other commands to execute while this one is running" option unchecked.


From the "Plugin command : ''" entry in the log I assume "ExecuteCommand()" currently uses the same underlying function as plugins would, which aren't necessarily triggered from a command, so aren't part of any one command's execution chain.



Would it be feasible to make commands executed using the "ExecuteCommand()" function part of the execution chain of the command the inline function is executed from?


EDIT: This is now possible in v1.7.5.4 using the "Execute(string CommandName, optional Boolean WaitForReturn, optional Boolean AsSubcommand)" overload for this method.
« Last Edit: April 22, 2019, 10:37:38 PM by Pfeil »