Memset Function

Action

Sets nCount characters of a memory buffer to a specified character.

Include file

Kernel.bdh

Syntax

Memset( in hDest  : number,
        in nChar  : number,
        in nCount : number ): number;

Return value

address of the destination memory pointer

Parameter Description
hDest Pointer to destination buffer
nChar ASCII value of the copied character
nCount Number of characters

Example

dcltrans
  transaction TMemset
  var
    nBuffer: number;
  begin
    nBuffer := Malloc(10);
    Memset(nBuffer, ord('*'), 10);
    write("buffer initialized"); writeln;
    Free(nBuffer);
  end TMemset;

Output

buffer initialized