|
Post by Stefan on Mar 7, 2021 14:58:35 GMT -5
Hi guys,
Is there a way to specify SPF_PARSE with mutually NON-exclusive keywords?
I have the following statement at the start of a macro...
IF SPF_Parse(1+Arg_Opt,0,0,0, _ "(EXCLUDE,X),(NOLAB,NL)", _ "OCC:(NEXT,N),(PREV,P),(FIRST,F),(LAST,L),ALL") _ > 0 THEN _ Halt(Get_RC,Get_Msg$) /* Operand error of some sort */ msg$ = DoLP(Get_Arg_TextLit$(1), _ Get_Arg_KWGroup$("OCC"), _ Get_Arg_KW("EXCLUDE"), _ Get_Arg_KW("NOLAB")) Halt(OK,msg$)
I call the LP macro with the following command LP X NL
i.e LP (macro name) X (for exclude) and NL (for NOLAB), so there is no text literal (optional)
Can I prevent SPF_PARSE returning an error with the message RC=8: Keyword: NL cannot be entered along with: X
ie: How can I allow multiple keyword operands without them being mutually exclusive?
Thanks
|
|
|
Post by Stefan on Mar 7, 2021 15:15:31 GMT -5
Replying to my own question - Bad show!
I think I've cracked it. Use the following (i.e separate literals as opposed to two separate entries in the same literal) instead
IF SPF_Parse(1+Arg_Opt,0,0,0, _ "(EXCLUDE,X)", _ "(NOLAB,NL)", _ "OCC:(NEXT,N),(PREV,P),(FIRST,F),(LAST,L),ALL") _ > 0 THEN _ Halt(Get_RC,Get_Msg$) /* Operand error of some sort */
Sorry - I've been on the gin!
|
|
|
Post by George on Mar 8, 2021 9:53:32 GMT -5
Stefan: Glad to see SPF_Parse being used. After looking at your 1st post I was thinking "Holy cow! I'm going to have to figure out how all that works again" to solve this.
It was a pain to create all that 'way back then' but your problem does show how flexible it can be made.
Glad you found it. Whew!
George
|
|