Author Topic: How to save CMDSEGMENT:1 to text variable?  (Read 387 times)

DownedAviator

  • Guest
How to save CMDSEGMENT:1 to text variable?
« on: July 20, 2024, 08:02:09 AM »
I have been trying various ways to save the value of token CMDSEGMENT:1 to a text variable without success.

Here is an example of what I tried, but the output of Say '[REGION]' just says the word region whatever I do.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4792
  • RTFM
Re: How to save CMDSEGMENT:1 to text variable?
« Reply #1 on: July 20, 2024, 08:05:03 AM »
You are correctly setting a text variable named "REGION" to the output of the "{CMDSEGMENT:}" token.

However, you are not retrieving the value of that variable later on, but rather just putting brackets around the variable name. That is not how tokens work.


Have a look at the documentation for the token that retrieves the value of a text variable.

DownedAviator

  • Guest
Re: How to save CMDSEGMENT:1 to text variable?
« Reply #2 on: July 20, 2024, 08:18:17 AM »
Thanks. I have searched through the very large documentation without finding an answer. I am sure it is in there somewhere but I have not found it even when using search features with various options. I have been using the excellent VoiceAttack for a few years and have successfully graduated to advanced functions over time. I have developed complex commands structures without ever having to resort to forum help before. I have RTFM!

This should be a simple action but I am stuck, so for my first request for help on the forum I would appreciate it if someone would kindly just tell me the correct syntax.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4792
  • RTFM
Re: How to save CMDSEGMENT:1 to text variable?
« Reply #3 on: July 20, 2024, 08:29:11 AM »
If you read the text before the list of tokens in the "Text (and Text-To-Speech) Tokens" section, it's shown multiple times, specifically mentioning that it's used to retrieve variable values.
Searching that section for "text variable" would have taken you to it.

The relevant token is
Code: [Select]
{TXT:}

DownedAviator

  • Guest
Re: How to save CMDSEGMENT:1 to text variable?
« Reply #4 on: July 20, 2024, 08:59:04 AM »
For anyone else that needs help with this:

Searching the FM with "text variable" 94 results. Answer was on 43rd.

Here is my working example.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4792
  • RTFM
Re: How to save CMDSEGMENT:1 to text variable?
« Reply #5 on: July 20, 2024, 09:00:38 AM »
Searching the FM with "text variable" 94 results. Answer was on 43rd.
That'd be why you'd want to search the section that documents tokens, specifically, where it's the very first result.

DownedAviator

  • Guest
Re: How to save CMDSEGMENT:1 to text variable?
« Reply #6 on: July 20, 2024, 09:02:40 AM »
Thanks Dad

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 292
  • Upstanding Lunatic
    • My AVCS Homepage
Re: How to save CMDSEGMENT:1 to text variable?
« Reply #7 on: July 21, 2024, 03:04:27 AM »
Thanks Dad

You really should not bring such attitudes to these forums, it is not welcome here.  All we do is help folks learn how to use this program we all love, and to point them in the right direction.  We typically do not simply drop "RTFM" memes and leave them to it, but point them specifically at the section or sections that may be relevant to what they are trying to accomplish.

You made a mistake when reading the reply by Pfeil, and this assumption was only yours - you should not be giving grief to someone who does nothing but help people every day for years and years out of the kindness of their heart.  I don't think there is anything technical or basic that Pfeil isn't personally familiar with given the decade (or more?) that he's been using VoiceAttack.

His statement to you was clear:
...in the "Text (and Text-To-Speech) Tokens" section, it's shown multiple times, specifically mentioning that it's used to retrieve variable values.
Searching that section for "text variable" would have taken you to it.
...

I think we can all be productive and helpful to each other here without throwing out unfriendly replies when we make mistakes reading or comprehending things - no one here (or anywhere else) is perfect.