Author Topic: full command and prefix with same root name  (Read 4360 times)

BlackJack

  • Jr. Member
  • **
  • Posts: 68
full command and prefix with same root name
« on: October 10, 2016, 09:20:24 AM »
In earlier program releases, I was able to set a full command and a prefix with same root name:

Cargo [1..10] (full)
Cargo [1..10] (prefix - Commodities)
Coffee;Tea;Fish (suffix - Commodities)

They are working without issues, but now I get an error message, when I try to edit one of these commands:

This profile already contains a spoken phrase, 'Cargo [1..10]'. Please choose a different one.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4757
  • RTFM
Re: full command and prefix with same root name
« Reply #1 on: October 10, 2016, 06:33:36 PM »
I'm assuming you're using the prefix/suffix to make specifying the cargo type optional, this can also be done using dynamic command sections:

Cargo [1..10] [Coffee;Tea;Fish;]
Code: [Select]
Set Text [CMD] to '{CMD}'
Set integer [CargoAmount] value to the converted value of {TXTNUM:CMD}
Begin Text Compare : [CMD] Ends With 'Coffee'
Else If Text Compare : [CMD] Ends With 'Tea'
Else If Text Compare : [CMD] Ends With 'Fish'
Else
End Condition
Note the final ";]" in the command name. This specifies that the command optionally contains the preceding words, but does not require them.

Them amount of derived commands remains the same, as prefix/suffix is a convenience feature which works with the speech engine just like any dynamically named command does.

BlackJack

  • Jr. Member
  • **
  • Posts: 68
Re: full command and prefix with same root name
« Reply #2 on: October 11, 2016, 11:01:11 AM »
Hi Pfeil.

I use the composite command to set {TXT:Cargo 1..10} to suffix (Fish), and the regular command reads out the variable again:

Said: 'Cargo 1 Fish'

prefix:
Code: [Select]
Set Text [CMD] to '{CMD}'
Set integer [Num] value to the converted value of {TXTNUM:CMD}
suffix:
Code: [Select]
Begin Integer Compare : [Num] Equals 1
    Set Text [Cargo 1] to '{SUFFIX}'
Else If Integer Compare : [Num] Equals 2
[...]
Say, Cargo {INT:Num} saved to '{TXT:Cargo {INT:Num}}'

Asked: 'Cargo 1'
Code: [Select]
Set Text [CMD] to '{CMD}'
Set integer [Num] value to the converted value of {TXTNUM:CMD}
Say, Cargo {INT:Num}, '{TXT:Cargo {INT:Num}}'

I started this in the way you are suggested, but it's difficult to handle the huge row with lots of commodities.
That's why I decided to use the "convenience feature" ;)

This is just one example. Here is an Other one:

Contacts (regular)    -> move to Tab(3)
If something went wrong, correction:
Contacts (prefix)       -> set Tab(3) as active
is activated (suffix)   -> move to Tab(1)

The point is, if you set one 'Contacts' to 'Contacts;dummy dum dum', VA has no problem with it.
So, why should it not be allowed to set command and prefix equally?
In my view, the restriction is not necessary. I'am wrong?

Regards

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: full command and prefix with same root name
« Reply #3 on: November 07, 2016, 07:04:37 PM »
I still need to look at this one.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: full command and prefix with same root name
« Reply #4 on: January 04, 2017, 09:51:57 PM »
Sorry, BlackJack.  This issue got pushed out of view, and so I consistently missed it.

I think I have this put back, and I have placed a build in the, 'unofficial' bin.  Should have a full beta by this weekend as well.

http://www.voiceattack.com/unofficial