John,
The low level calls need an exact match of parameters with the callee function.
But it is easy to take the g value and create a function declaration from it. Then you have all the facilities of a high level function including optional parameters.
sys g=@fun
declare function f (v as sys, optional a as sys, b as sys) at g
'========================================
'OPTIONAL PARAMETERS + FUNCTION ADDRESSES
'========================================
'-----------------------------------------------------------
function fun(v as sys, optional a as sys, b as sys) external
'===========================================================
string opts
'
'
'check to see if the address of b is null
'
if @a then
opts+=" A = "+str(a)
else
opts+=" A is not specified "
end if
if @b then
opts+=" B = "+str(b)
else
opts+=" B is not specified "
end if
'
print "V = " str(v) chr(13) chr(10) opts
'
end function
'SOME DATA
'=========
sys vv=42
'GET FUNCTION ADDRESS
'====================
sys g=@fun
'USE G TO CREATE A FUNCTION DECLARATION WITH A FULL PROTOTYPE
'============================================================
declare function f (v as sys, optional a as sys, b as sys) at g
'======
'TESTS:
'======
f vv 'A AND B NOT SPECIFIED
f vv,123 'A SPECIFIED
f vv,,456 'B SPECIFIED (A SET TO 0)
f vv,123,456 'BOTH SPECIFIED
Charles