Retrieve one or more substrings from the memory buffer pointed by <pMem> starting at position <nShift>.
Syntax:
PeekStr(<pMem>,[[@]<nShift>],<nSize>) -> <cStr>
PeekStr(<pMem>,[[@]<nShift>],-1) -> <cStr>
PeekStr(<pMem>,[[@]<nShift>],@<cStr>) -> <nSize>
PeekStr(<pMem>,[[@]<nShift>],[@]<aSizes>) -> <aStr>
Parameters:
<pMem>
Base pointer to the memory buffer.
<nShift>
Zero based starting position within <pMem>. If this parameter is passed by reference will be increased with the number of bytes retrieved, to reuse it in subsequent calls of Peek...() functions.
<nSize>
Number of bytes to retrieve. If <nSize> == -1 a NULL terminated string is assumed and PeekStr() will retrieve the bytes up to the first NULL character.
Note: Using the -1 param with non NULL terminated string can result in a internal exception.
<cStr>
Character variable to fill with Len(<cStr>) bytes if provided by reference.
<aSizes>
Array with the number of bytes to retrieve per element. If an element of <aSizes> contains a character value will be take the size of the provided string element.
Return Value:
Depending on the syntax used PeekStr() can return the following values:
| • | <cStr> Substring extracted from the memory buffer. |
| • | <nSize> Number of bytes stored in the 3rd parameter. |
| • | <aStr> Array with the substrings extracted from the memory buffer. |