Author Topic: Add Error Checking to Passed Text variables  (Read 3025 times)

THX1959

  • Newbie
  • *
  • Posts: 4
Add Error Checking to Passed Text variables
« on: July 10, 2021, 08:36:42 AM »
It would be nice to get a warning if the user attempts to pass an un-quoted Text value to another command.

It would be even nicer if VA simply fixed the issue silently. Honestly, given that the dialog says "Text" it should mean anything I put here is going to be recognized literally "AS TEXT" and not completely ghost me with an accepted command that actually isn't functional.

It's an exceedingly easy mistake to make, at least for me, and can be the absolute devil to find.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4760
  • RTFM
Re: Add Error Checking to Passed Text variables
« Reply #1 on: July 10, 2021, 10:12:06 AM »
As the documentation for that advanced feature notes, unquoted text is interpreted as a variable name.

Reading the documentation, especially for advanced features, is strongly recommended; press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: Add Error Checking to Passed Text variables
« Reply #2 on: July 10, 2021, 08:32:16 PM »
This is correct - if the value that you are passing in is not enclosed in quotes, the token parser assumes it is a variable name (dual-purpose).  Variables can have a value of 'Not set' (null), so there is no way to tell if the intent was to pass a variable or detect if it is literal text, accidentally placed.