Author Topic: Command wait end of others for execute  (Read 2521 times)

Sloboda

  • Jr. Member
  • **
  • Posts: 74
  • VoiceCommander Creator
    • A.M.I.S. X Plane
Command wait end of others for execute
« on: April 26, 2017, 11:34:31 AM »
Hello,

if it's possible, i would like a preference in commands for the command wait the end of command on course to be executed. (sorry for my bad english...)
At now, we can check "Allow other commands to be executed...."
the problem, that's work on a way, not on reverse.
Because if i check this box, i delay all other commands.
I prefere on a command, check: wait other commands on course before continue.

Sorry again, i hope i am clear.

Have a good day.
Best regards.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Command wait end of others for execute
« Reply #1 on: April 26, 2017, 12:40:46 PM »
The reason there is not an explicit feature like you are describing is because there is no way to easily express it simply to an end-user.  I mean, it would be easy to have a command that doesn't execute if another command is running, but the problem compounds when you don't want a particular command to execute if this command OR that command is executing, or this command is executing and this condition is set to 2 and only if the mouse back button is down, etc, etc.  So, you can see there's no way to make an effective interface that can handle that.

To make what you are describing work, you will need to define a variable at the start of your first command that is set to true and then set to false at the end of that command.  From the command that you don't want to execute until the first is done, you will need to check to see if that variable is true.   Something like this:

Command A
Set Boolean commandAVar to True
Do command stuff here
Set commandAVar to False


Command B
Loop While commandAVar Equals True
Pause .001
End Loop
Do command stuff here

Rhaedas

  • Jr. Member
  • **
  • Posts: 72
Re: Command wait end of others for execute
« Reply #2 on: April 26, 2017, 02:29:48 PM »
I think using flag variables is more flexible than any interface could be anyway. My recent one that flashes lights does exactly this, sets an on flag before it fires. If one of the other light commands gets called in the middle, they see the flag and know to wait until it clears before running.