I would like to be able to call an intialization wrapper function in one of two ways. Either with two parameters specified or with no parameters specified.
CALL InitArrays( 1024, 512 )
or just
CALL InitArrays
in the second case default values inside the function would be used.
I can declare and compile the function like this:
This GPF's
Manual says:
but doesn't explicitly mention declaring ALL parameters as OPTIONAL.
Is it possible?
CALL InitArrays( 1024, 512 )
or just
CALL InitArrays
in the second case default values inside the function would be used.
I can declare and compile the function like this:
Code:
FUNCTION InitArray( OPTIONAL BYVAL InitSz AS DWORD, GrowSz AS DWORD ) AS DWORD IF InitSz = 0 THEN InitSz = 999 IF GrowSz = 0 THEN GrowSz = 99 FUNCTION = Init( InitSz, GrowSz ) ' END FUNCTION
Manual says:
When optional parameters are omitted in the calling code, the stack area normally reserved for those parameters is zero-filled, so BYVAL parameters default to the value 0
Is it possible?
Comment