06-08-2025, 03:47 PM
Function VariantArgsToArray
;/
function ARRAY(VARIANT)&a VARIANT&firstParam nParamsBefore
;Creates ARRAY(VARIANT) a and moves VARIANT parameters of the caller function to it.
;a - ARRAY(VARIANT) variable. This function creates the array.
;firstParam - address of the first VARIANT parameter.
;nParamsBefore - the number of function parameters before the first VARIANT parameter.
;EXAMPLE
;function` $name [`_A1] [`_A2] [`_A3] [`_A4] [`_A5] [`_A6]
;ARRAY(VARIANT) a; VariantArgsToArray a &_A1 1
int na = getopt(nargs 1)-nParamsBefore
a.create(na)
if na>0
,na*sizeof(VARIANT)
,memcpy &a[0] &firstParam na
,memset &firstParam 0 na