SaxBasic: Optional Lists

Hello all,

is it possible to use an list optionally, e. g. like
Command <List1> <List2>
but <List2> might be optional?

Thanks and greetings
Udo

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

is this about

is this about vocola????

Quintijn

Hello Quintijn,

Hello Quintijn,

no, SaxBasic! Subject complemented Eye-wink.

Thanks and greetings
Udo

No, because the recognizer

No, because the recognizer won't be able to recognize the command! The work around is to write two commands -- one with and another with both list1 and list2. If the write the latter first, then the first is a simple modification Smiling

Hello BruceCyr, If the write

Hello BruceCyr,

If the write the latter first, then the first is a simple modification.

Yep, always done so, but sometimes asking "opens new skylines".

Thanks and greetings
Udo

Sorry folks, I do not know

Sorry folks,

I do not know about SaxBasic, and do not understand the question at all.

All natlink grammars can have a construct like
command = <list> [<list>];

Quintijn

PS Udo, you're very cryptic with your questions lately

Hello Quintijn, I do not

Hello Quintijn,

I do not know about SaxBasic, and do not understand the question at all.

And what do you not understand?

All natlink grammars can have a construct like
command = <list> [<list>];

I just tested with Vocola

Test List <lTest1> [<lTest2>] = "Test " $1 " " $2 ;
<lTest1> := ( one = 1  | two = 2  | three = 3  ) ;
<lTest2> := ( one = 10 | two = 20 | three = 30 ) ;

When I say e. g. "Test List one one" the command is recognized correctly, but the result is

Test_1_

That means the optional list [<lTest2>] is ignored.

Thanks and greetings
Udo

So this a vocola issue.

So this a vocola issue.

Again, sometimes it should be better to do these sort of constructs in natlink (so preferably unimacro) grammars.

For example, if you want more complex numbers to be called, look into the numbers grammar of unimacro. Not enough documented, I regret, but working in firefox browsing all the time!

See at the bottom of the firefox browsing grammar of unimacro

Quintijn

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.




view recent posts