Passing Optional Parameters

Previous topic - Next topic

aroldo

Is it possible to have optional parameters in FUNCTIONS?


For instance in the example below z may be optional.

Code (glbasic) Select
FUNCTION object: x, y, z (as optional)
        .
        .
        .
ENDFUNCTION
[a http://apd-games.com/][img http://apd-games.com/images/APDGames135.png][/a]
MacBook Pro OS X El Capitan
XCode Version 7
iPhone 6 running  iOS 9
iPad Mini running  iOS 7.1
Galaxy S5
Dell Latitude Windows 8 Enterprise
Palm Pre, Palm Pre2

kanonet

It is:

Code (glbasic) Select
FUNCTION object: x, y, z=3
        .
        .
        .
ENDFUNCTION
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

aroldo

[a http://apd-games.com/][img http://apd-games.com/images/APDGames135.png][/a]
MacBook Pro OS X El Capitan
XCode Version 7
iPhone 6 running  iOS 9
iPad Mini running  iOS 7.1
Galaxy S5
Dell Latitude Windows 8 Enterprise
Palm Pre, Palm Pre2

Emil

have been wondering about that for quite some time :)
thanks!