>> This is NOT a bug, and it's 100% Clipper compatible. This can be 
>> corrected to work like this:
>>
>> -----------------------------------------------------------------------------
>> #command TEST <right: RIGHT> [<pad>]]                                  ;
>>              [COLOR <nClrFore> [,<nClrBack>]]                          ;
>>                                                                        ;
>>      => Test( <.right.>, <pad>, <nClrFore>, <nClrBack> )
>>
>> FUNCTION MAIN()
>>
>>    TEST COLOR 1, 2 RIGHT 10  // first syntax
>>    TEST RIGHT 10 COLOR 1, 2  // second syntax
>>
>>    RETURN NIL
>
> Sorry, I can't see any difference between my sample and your corrected 
> version above.

The difference is the removal of the BRACKETS which make the RIGHT clause 
OPTIONAL.

>> The problem is the Clipper PP does NOT consider RESTRICTED MATCH MARKER a 
>> STOPPER when skipping over OPTIONAL input. I'm sorry that I don't have a 
>> more descriptive explanation as this is very technical. If you tried to 
>> develop a Clipper compatible Pre-Processor it would become crystal clear.
>
> Ok, I believe you. But if there is a workaround I would like to know it, 
> thank you.

The workaround:

   #command TEST RIGHT [<pad>]                                  ;
                        [COLOR <nClrFore> [,<nClrBack>]]          ;
      => Test( .T., <pad>, <nClrFore>, <nClrBack> )

   #command TEST [COLOR <nClrFore> [,<nClrBack>]] ;
      => Test( .F.  NIL, <nClrFore>, <nClrBack> )

Ron 


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
xHarbour-developers mailing list
xHarbour-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xharbour-developers

Reply via email to