Author Topic: dictating a string to a decimal variable  (Read 1222 times)

va_gene

  • Newbie
  • *
  • Posts: 17
dictating a string to a decimal variable
« on: May 25, 2023, 09:54:41 PM »
I hate to ask this after looking through the numerous threads on concatenation.  But I want to dictate a frequency example "NAV ONE SET ONE ONE TWO POINT FIVE ZERO" and send a decimal variable to SPAD.NEXT that looks like 1125000000  with the zeroes appended

my command is "nav 1 set"
each spoken response creates the variable respectively t1, t2, t3...

how do I cat these variables and then get my decimal variable in hertz?  Please and thank you

Code: [Select]
Wait for spoken response: '1;2;3;4;5;6;7;8;9;0'
Wait for spoken response: '1;2;3;4;5;6;7;8;9;0'
Wait for spoken response: '1;2;3;4;5;6;7;8;9;0'
Wait for spoken response: 'point'
Wait for spoken response: '1;2;3;4;5;6;7;8;9;0'
Wait for spoken response: '1;2;3;4;5;6;7;8;9;0'
Set text [nav1_hz] to 't1 t1 t3 t4 t5'
Convert text [nav1_hz] to decimal [nav1_megahertz]


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: dictating a string to a decimal variable
« Reply #1 on: May 25, 2023, 10:02:26 PM »
Have you read the documentation on tokens?

Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer, which contains information on VoiceAttack's features.

This topic may also be of use, in addition to the official documentation:
Variables and tokens summed up


Tokens are text, so if you use the appropriate token for each of your variables to retrieve their value, you can put them one after the other, followed by the zeroes you need, and then set your decimal value directly using the "Set a Decimal Value" action's "Convert Text/Token" option.

va_gene

  • Newbie
  • *
  • Posts: 17
Re: dictating a string to a decimal variable
« Reply #2 on: May 26, 2023, 07:03:10 PM »
I apologize for posting this, I figured this out today after the obligatory RTFM.  Thank you.