Author Topic: Access CMDSEGMENT if command has wildcard  (Read 1282 times)

janjan

  • Newbie
  • *
  • Posts: 42
Access CMDSEGMENT if command has wildcard
« on: April 21, 2020, 03:53:12 AM »
Is it possible to access a segment if command had a wildcard it it?
Below is just a checker for the 1st part of the command:

This is working  and yield "Is That North/Sough"
set Latitude [North;South] [point;decimal]
Is that {CMDSEGMENT:1}

This is not working and CMDSEGMENT:1 is always Not Set.
set Latitude [North;South] [point*;decimal*]
Is that {CMDSEGMENT:1}

I do that since set Latitude [North;South;East;West] [20..50] point [0..999] yields a lot of options and I'm a bit concern regarding resources.

Of course in BMS and DCS I do not need the south co- ordinates...
« Last Edit: April 21, 2020, 04:46:40 AM by janjan »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4787
  • RTFM
Re: Access CMDSEGMENT if command has wildcard
« Reply #1 on: April 21, 2020, 09:41:50 AM »
No.

However, there are usually multiple ways to approach something like this; If one option doesn't work out, try another.


E.G. if you need to know whether "north" or "south" was spoken, you can check just that:
Code: [Select]
Begin Text Compare : [{CMD}] Contains 'North'
    Write [Blue] 'Is that north' to log
Else
    Write [Blue] 'Is that south' to log
End Condition


As an aside, you can right-click the action list and choose "Copy All as Text" (or "Copy Selected as Text", if you have made a selection) to paste here on the forum or in Discord (do use code tags for the former by clicking the "#" button).

janjan

  • Newbie
  • *
  • Posts: 42
Re: Access CMDSEGMENT if command has wildcard
« Reply #2 on: April 21, 2020, 10:57:03 AM »
Thanks,
My intention was to save the 30x1000 or so combinations.
I wanted to reduce that by catching, in my case:

Code: [Select]
set Latitude [North;South] [*point*;*decimal*]
then
Code: [Select]
set a text variable to {TXTNUM:"{CMDSEGMENT:2}"}

However, I understand this is not possible.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4787
  • RTFM
Re: Access CMDSEGMENT if command has wildcard
« Reply #3 on: April 21, 2020, 10:59:42 AM »
...you can get anything spoken after the wildcard using the "{CMD_AFTER}" token...