Author Topic: [v1.8.3.27] Command-scoped/shared variables not cleared when repeating command  (Read 1679 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
When repeating a command using the "Repeat Command Phrases" feature, command-scoped variables (prefixed with "~"), and command-shared variables (prefixed with "~~") will retain their values, as long as no other spoken command is executed (at which point that command will become what is executed instead; Executing the first command again, then repeating it, will not have the original values still retained).

This occurs even if other (non-spoken) commands are executed, even if those commands use the same variable names (which is correct, just wanted to make sure the cache wasn't overwritten by other commands).


I checked every full version back to 1.7 (in which the "Repeat Command Phrases" feature was introduced), and this applies all to all of them (as a sanity check I made sure command-scoped variables were actually a thing in that version, and they are; That feature was introduced in v1.6.2).



Tested using a number of commands, but the main one is this:
Code: [Select]
Write [Blue] '~pre = {TXT:~test}' to log
Write [Blue] '~~ pre = {TXT:~~test}' to log
Begin Text Compare : [~test] Has Not Been Set
    Set text [~test] to 'test'
End Condition
Begin Text Compare : [~~test] Has Not Been Set
    Set text [~~test] to 'test2'
End Condition
Write [Blue] '~post = {TXT:~test}' to log
Write [Blue] '~~ post = {TXT:~~test}' to log
Where the "pre" values should always be "Not set", which they aren't when repeating.

This command is attached, should it be useful for debugging.


EDIT: Appears to be working correctly with v1.8.3.28
« Last Edit: March 14, 2020, 05:10:04 PM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Ooooo... yeah, you're right.  Good catch on that one.  Items were cached up and not released.

Hoping the unofficial build (v1.8.3.28) I've uploaded to http://voiceattack.com/u fixes your issue.

Thanks for the steps to reproduce and the awesome profile, Pfeil!