Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hello , memset not funktion.
#2
Use CUSTOMTYPE to avoid the C++ error.

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.
Reply


Messages In This Thread
hello , memset not funktion. - by funkheld - 10-13-2024, 08:49 AM
RE: hello , memset not funktion. - by a740g - 10-13-2024, 12:02 PM



Users browsing this thread: 1 Guest(s)