In the first wrapper/Sub pair PBMAIN
makes a "call " to the wrapper with and without a parameter and
compiles fine..
In the 2nd wrapper/Sub pair PBMAIN fails on the first "call " to the
wrapper.. the one without the 2nd parameter..
Am I missing something?
Thanks
makes a "call " to the wrapper with and without a parameter and
compiles fine..
In the 2nd wrapper/Sub pair PBMAIN fails on the first "call " to the
wrapper.. the one without the 2nd parameter..
Am I missing something?
Thanks
Code:
#COMPILE EXE #DIM ALL GLOBAL B AS LONG MACRO Wrapper1(AAA) CALL Func1(AAA) END MACRO SUB Funct1(OPT B AS LONG) LOCAL Passed AS LONG Passed=IIF(VARPTR(B)=0,0,-1) IF Passed<>0 THEN ? "B="+STR$(B) ELSE ? "Wrapper1 2nd parameter not passed" END IF END SUB MACRO Wrapper2(AAA,BBB) CALL Func1(AAA,BBB) END MACRO SUB Funct2(BYVAL A AS LONG, OPT B AS LONG) LOCAL Passed AS LONG Passed =IIF(VARPTR(B)=0,0,-1) IF Passed<>0 THEN ? "B="+STR$(B) ELSE ? "Wrapper1 2nd parameter not passed" END IF END SUB FUNCTION PBMAIN () AS LONG LOCAL I, J AS LONG B=6 I=1 J=2 K=3 Wrapper1() 'compiles - no optional parameter passed Wrapper1(I) 'compiles parameter passed '---- comment out the next 2 lines and it compiles and works Wrapper2(I) 'Mismatch with prior definition Wrapper2(I,J) END FUNCTION
Comment