Author Topic: Unable to set command-scoped variables as command parameters when using queues  (Read 2451 times)

alterNERDtive

  • Jr. Member
  • **
  • Posts: 52
So, I’ve had a little bug that has cost me some years of my life …

If you try sending a command scoped variable (~) as a parameter to another command _while using command queues_ it won’t work. Regular command invocation is just fine.

Minimal profile example attached, just run the “test” command and watch the log.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
I'd have to code dive on that to find out what's up (not at my PC atm).  My first thought is that it may have to do with when the variable's value is rendered for use.  For queued commands, that value is rendered at the point of execution.  Wonder if there should maybe be an option of when a variable's value should be captured as a queued command is executed asynchronously and the command that invoked queue may not even be around any more.

Thanks for the heads up!

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
It was just as I had suspected - the variables/tokens are evaluated at the time that the enqueued command is actually executed.  Since an enqueued command is only ever executed as a base command (and not a subcommand), this didn't seem like a problem.  When a command is queued, it is out of scope in regards to the command that enqueued it (thereby losing access to command-scoped/shared variables).   

So, what I did was add an option to the Enqueue Command screen that will let you evaluate the passed values at the point when the command is enqueued. That way the command-scoped/shared variables from the calling command can be accessed (before sending the enqueued command off for life on its own).  Hope this is making sense o_O

If you are interested, I uploaded a build (v1.8.6.1 - just the .exe) to the, 'unofficial' bin:  http://voiceattack.com/u
The only difference between that version and the full release version is this option (no other changes in there yet).  This way you can get on with your work and not have to wait until the next beta ;)  Simply replace your VoiceAttack.exe with this one and you'll be set.

Thanks again for pointing that out - I'm actually rather thrilled that this stuff is getting used ;)

alterNERDtive

  • Jr. Member
  • **
  • Posts: 52
It was just as I had suspected - the variables/tokens are evaluated at the time that the enqueued command is actually executed.

Yeah, thought it would be something along those lines.

If you are interested, I uploaded a build (v1.8.6.1 - just the .exe) to the, 'unofficial' bin:  http://voiceattack.com/u

When do you expect .6.1 to release? I plan on releasing my stuff to the public soon™ and I’d rather not have to point them there, too. So if the answer is not “next week or so” I’ll probably have to wait.

Thanks again for pointing that out - I'm actually rather thrilled that this stuff is getting used ;)

Now imagine how thrilled I was that parameters finally became a thing.

Edit: can confirm that it worksforme™.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
I don't have an ETA on when the next beta will be out, unfortunately.  The good news is it might have passed values for commands from the command line, though.

Edit - this is in the latest beta!
« Last Edit: July 26, 2020, 01:01:55 AM by Gary »