Menu

#46 Expanded support for variable-len arguments

closed
None
2019-05-04
2006-01-05
No

*** Allow the passing of a variable length argument
list from one function to another:

SUB func1(a as integer, ...)
dim b as va_list;

func2(b);

END SUB

SUB func2(a as integer, ...)
...
END SUB

Example: the C RTL functions printf() and vprintf().

*** Add a mechanism to allow a variable length
argument list function or sub to know the number of
arguments without requiring the use of a parameter
that explicitly tell it:

SUB func1(a as integer, ...)
dim as integer b, i
b = va_count(a) ' would return the number of
arguemnts that follow a
for i = 1 to b
... use va_arg() to iterate the values
next i
va_end()
...
END SUB

OR make va_arg() return a special value when the last
value from the variable arg list has been retrieved.

Discussion

  • Jeff Marshall

    Jeff Marshall - 2019-05-04
    • status: open --> closed
    • assigned_to: Jeff Marshall
     

Log in to post a comment.