Hi John,
Sorry for the delay, I have just had a cold, a real streamer.
There are a large number of permutations for declaring functions, including C style header declarations.
"!" replaces declare funcion or declare sub
You can also declare without specifying function or sub
To specify a variable number of parameters, use ellipsis
Use null for null parameters
They usually take the form of an integer specifying the number of params, followed by the ellipsis
function f (sys n,...) as sys
=============================
sys *p : @p=@n
indexbase 0
for i=1 to n
print p[i]
next
end function
f(3,10,20,30)
Using pure ellipsis is a little more tricky, and unusual. The offset will change when a function is exported, and/or 64bit.
function f (...) as sys
=======================
sys p
lea eax,[ebp]
mov p,eax
p+=2*sizeof sys
do
if *p=0
exit do
end if
print *p
p+=sizeof sys
enddo
end function
f(3,10,20,30,null)
I could fully implement this form by making a parameter array available
Charles