juantorres
Newbie
Posts: 2
Joined: Fri Jul 15, 2016 7:46 pm

SIML match a set

Wed Jul 20, 2016 4:41 am

Hi, Im trying to match user user input to a specific set. I have defined a set:

Code: Select all

<Siml>
  <Set Name="ONE">
    <Item>1</Item>
    <Item>ONE</Item>
    <Item>UNO</Item>
  </Set>
</Siml>
How should I reference shuch set to match a pattern in which there are several wildcards, like the following:

Code: Select all

 <Model>
      <Pattern>
        <Item>NUMBER [ONE]</Item>
        <Item>THE NUMBER * [ONE]</Item>
      </Pattern>
      <Response>Selected number <User Set="NUM"><Match /></User></Response>
    </Model>
And I require the user setting NUM to have a VALUE=ONE, any help would be great.

User avatar
Fantom
Help & Support
Posts: 303
Joined: Fri Oct 25, 2013 9:20 pm

Re: SIML match a set

Wed Jul 20, 2016 1:36 pm

Match tag will always carry the captured wildcard at the right index. So one cannot change the value it holds at run-time.

Maybe you can use a different approach.

SIML Code

<Model>
  <Pattern>PROCESS NUMBER *</Pattern>
  <Response>The value is <Match /></Response>
</Model>

<Model>
  <Pattern>THE NUMBER * [ONE]</Pattern>
  <Response>
	<Goto>Process number <Match Index="2" /></Goto>
  </Response>
</Model>

<Model>
  <Pattern>NUMBER [ONE]</Pattern>
  <Response>
	<Goto>Process number <Match /></Goto>
  </Response>
</Model>

juantorres
Newbie
Posts: 2
Joined: Fri Jul 15, 2016 7:46 pm

Re: SIML match a set

Thu Jul 21, 2016 6:17 pm

Thanks for the prompt response. I'll try that approach.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest