I hate to be a pain, but being new to PB and with the users manual so criptic, it is difficult to figure things out. There are two questions concerning optional parameters in an argument list. Here is sample code:
DEFINT A - Z
DIM aPtr AS DWORD
aPtr = CODEPTR32(AProc)
A = 3
B = 7
D = 9
C = 25
E = 99
CALL DWORD aPtr CDECL(A, B, E)
'CALL Aproc CDECL(A, B, E)
END
SUB Aproc CDECL(N [,I, J, L, M, O])
PRINT N, I, J, L
END SUB
The questions are:
1. Other than using asm, is there a way to tell how many parameters were passed? Printing "L" gives a "null pointer error" (error #211). The value of N in the above is 99 instead of 3 which is clearly incorrect. I realize that the parameters are placed on the stack from right to left, but it seems that N still should equal A regardless of the pass sequence.
2. In the above code "CALL Aproc CDECL(A, B, E)" produces error #481 "parameter mismatch - may need by copy". Why? It is of the same form except for DWORD aPtr.
DEFINT A - Z
DIM aPtr AS DWORD
aPtr = CODEPTR32(AProc)
A = 3
B = 7
D = 9
C = 25
E = 99
CALL DWORD aPtr CDECL(A, B, E)
'CALL Aproc CDECL(A, B, E)
END
SUB Aproc CDECL(N [,I, J, L, M, O])
PRINT N, I, J, L
END SUB
The questions are:
1. Other than using asm, is there a way to tell how many parameters were passed? Printing "L" gives a "null pointer error" (error #211). The value of N in the above is 99 instead of 3 which is clearly incorrect. I realize that the parameters are placed on the stack from right to left, but it seems that N still should equal A regardless of the pass sequence.
2. In the above code "CALL Aproc CDECL(A, B, E)" produces error #481 "parameter mismatch - may need by copy". Why? It is of the same form except for DWORD aPtr.
Comment