10-13-2024, 12:02 PM
Use CUSTOMTYPE to avoid the C++ error.
Also, memset will not work the way you are probably expecting for anything other than _BYTE arrays.
Code: (Select All)
DECLARE CUSTOMTYPE LIBRARY
FUNCTION memsetB& ALIAS memset (p AS _BYTE, BYVAL c AS LONG, BYVAL n AS _UNSIGNED _OFFSET)
FUNCTION memsetI& ALIAS memset (p AS INTEGER, BYVAL c AS LONG, BYVAL n AS _UNSIGNED _OFFSET)
FUNCTION memsetL& ALIAS memset (p AS LONG, BYVAL c AS LONG, BYVAL n AS _UNSIGNED _OFFSET)
END DECLARE
DIM Barray(1 TO 10) AS _BYTE
res& = memsetB(Barray(1), 65, 5)
FOR i = 1 TO 10
PRINT Barray(i); 'display BYTE array decimal values
NEXT
PRINT: PRINT
DIM Larray(1 TO 10) AS LONG
res& = memsetL(Larray(1), 65, 5)
FOR i = 1 TO 10
PRINT Larray(i); 'displays LONG array decimal values
NEXT i
PRINT
FOR i = 1 TO 10
PRINT " " + HEX$(Larray(i)); 'displays each byte value &H41 = 65
NEXT i
Also, memset will not work the way you are probably expecting for anything other than _BYTE arrays.