Function variable arguments

Blitz3D Forums/Blitz3D Beginners Area/Function variable arguments

DeCato(Posted 2008) [#1]
Hi,

Some native functions in Blitz3D have a variable parameter list where the last x parameters can be left out when calling the function (ie Graphics3D, Rand, Flip, ...)

Is this only possible for system functions or can I do something similar with my own functions (it would really be handy if I could) ?

DeCato


GfK(Posted 2008) [#2]
myFunction(1,5)
myfunction(1)

Function myFunction(a,b=2)
  Print "A = " + A + ", B = " + B
End Function


(should give you 1,5 and 1,2)


DeCato(Posted 2008) [#3]
Great.

Thanks for such a quick and helpfull reply ;-)