I want to write a function that has an array as a parameter.
Starting with the working scalar example,
FUNCTION P(b AS LONG) AS LONG:MSGBOX STR$(b):END FUNCTION
FUNCTION PBMAIN() AS LONG
LOCAL a AS LONG
a=4:P(a)
END FUNCTION
here is one of the many examples I tried that did not work.
FUNCTION P(b() AS LONG) AS LONG:MSGBOX STR$(b(4)):END FUNCTION
FUNCTION PBMAIN() AS LONG
DIM a(4) AS LONG:a(4)=-4:P(a())
END FUNCTION
There is no documentation on how to pass arrays to a function.
The old DOS PB compiler did have it. Perhaps it is no
longer permitted in the CC and DLL verions?
Anyone have any recommendations?
BTW it was a pleasant surprise to find out that MSGBOX worked
as the PRINT statement in the DLL compiler when executing
from a DOS prompt. It would be useful to include that info
in the manual under PRINT (not supported, see MSGBOX; then
include an explanation in the REMARKS section of MSGBOX).
Starting with the working scalar example,
FUNCTION P(b AS LONG) AS LONG:MSGBOX STR$(b):END FUNCTION
FUNCTION PBMAIN() AS LONG
LOCAL a AS LONG
a=4:P(a)
END FUNCTION
here is one of the many examples I tried that did not work.
FUNCTION P(b() AS LONG) AS LONG:MSGBOX STR$(b(4)):END FUNCTION
FUNCTION PBMAIN() AS LONG
DIM a(4) AS LONG:a(4)=-4:P(a())
END FUNCTION
There is no documentation on how to pass arrays to a function.
The old DOS PB compiler did have it. Perhaps it is no
longer permitted in the CC and DLL verions?
Anyone have any recommendations?
BTW it was a pleasant surprise to find out that MSGBOX worked
as the PRINT statement in the DLL compiler when executing
from a DOS prompt. It would be useful to include that info
in the manual under PRINT (not supported, see MSGBOX; then
include an explanation in the REMARKS section of MSGBOX).
Comment