10-13-2024, 08:49 AM
hello, good day.
I can't get this memset demo to work.
thanks. regards
I can't get this memset demo to work.
thanks. regards
Code: (Select All)
DECLARE LIBRARY
FUNCTION memsetB& ALIAS memset (p AS _BYTE, BYVAL c AS _UNSIGNED LONG, BYVAL n AS _UNSIGNED LONG)
FUNCTION memsetI& ALIAS memset (p AS INTEGER, BYVAL c AS _UNSIGNED LONG, BYVAL n AS _UNSIGNED LONG)
FUNCTION memsetL& ALIAS memset (p AS LONG, BYVAL c AS _UNSIGNED LONG, BYVAL n AS _UNSIGNED LONG)
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