|
Post by Robert on Nov 24, 2023 15:13:58 GMT -5
The SPF_Parse function will return enumerated lists of certain values. To get a particular value from position n of a list, you call one of these functions:
Get_Arg_LRef$(n)
Get_Arg_NumLit$(n)
Get_Arg_Tag$(n)
Get_Arg_TextLit$(n)
However, there is no way to know how many values exist in any one of these lists. The only way to tell is loop through them until one of the functions returns a "" null string.
The suggestion is to provide a way to directly ask for the upper limit of each list. To make them comparable to the standard Get_Arg_Count function, the following names could be used:
Get_Arg_LRef_Count Get_Arg_NumLit_Count Get_Arg_Tag_Count Get_Arg_TextLit_Count
|
|
|
Post by George on Nov 24, 2023 16:34:00 GMT -5
Robert: What options were specified? ARG_VAR? ARG_OPT?
Regardless, a count would be helpful.
George
|
|
|
Post by Robert on Nov 24, 2023 19:13:46 GMT -5
I don't think that the various VAR options really matter here. Those options only control what is considered "valid" by the parse. The macro writer still doesn't know exactly how many are present, unless you ask for an exact number by leaving the ARG_xxx off.
ARG_VAR: number of arguments can vary from 0 to n.
ARG_OPT: arguments are optional, and can be either 0 OR n.
ARG_DEF: only applies to labels, and requires that they be defined.
So, suppose you ask for 2+ARG_OPT labels, and you want to know if you got 0 or 2. You can either ask if entry 1 is null (= 0) or ask if 2 is not null (= 2). But this is awkward, and the code to do it is ugly.
|
|
|
Post by George on Nov 30, 2023 12:48:41 GMT -5
Robert: Are these still on your 'wish list'? Get_Arg_LRef_Count Get_Arg_NumLit_Count Get_Arg_Tag_Count Get_Arg_TextLit_Count
George
[UPDATE] They're done [/UPDATE]
|
|