Clib Get Memory Method

The Clib Get Memory method searches a buffer for the first occurrence of a character that you specify. It returns one of the following values:

  • If it finds the character you specify, then it returns the contents of the buffer starting at that character.

  • If it does not find the character you specify, then it returns the following value:

    Null

Format

Clib.memchr(bufferVar, char[, size])

The following table describes the arguments for the Clib Get Memory method.

Argument Description

bufferVar

A buffer or a variable that references a buffer.

char

The character that this method attempts to locate.

size

The number of bytes of the buffer that this method searches. It does one of the following depending on if you specify a size:

  • You do specify a size. It searches at the beginning of the buffer and continues until it reaches the point in the buffer that you indicate in the size argument. For example, if you specify the size as 1024, then it searches the first 1024 bytes of the buffer.

  • You do not specify a size. It searches the entire buffer from the first byte.