CopyMemoryToString - Transfer data from memory to a string |
Top Previous Next |
<cString> := CopyMemoryToString( <nAddress>, [<nType>], [<nStringLen>], [@<nBytesRead>], [<lEmptyStringOnNull>] ) <nAddress>
Start address of string in memory.
<nType>
Type of string data to be read from memory. See Cockpit string types for details. The default value is STRINGTYPE_BINARY.
<nStringLen>
Number of characters to be read. If this parameter is not specified, automatic size determination according to <nType> will take place.
<nBytesRead>
Number of bytes read during the operation.
<lEmptyStringOnNull>
This flag indicates if an empty string should be returned in case <nAddress> equals zero. If this flag is .F. (which is the default), NIL will be returned if <nAddress> equals zero. String in Cockpit application character set that was found at address <nAddress>. If <nAddress> is 0, NIL or an empty string ("") is returned depending on <lEmptyStringOnNull>. A string starting in memory at <nAddress> is read and returned as a character value. During the transfer from memory to the returned string character set conversions will be performed according to <nType>. See Cockpit string types for details.
If a string length is not passed in <nStringLen>, termination is derived from <nType>. If STRINGTYPE_BINARY was passed for <nType> and no length information was given, a NULL-byte terminator is assumed. If a string length is not given, <nBytesRead> will include the terminator.
If a string length is passed in <nStringLen>, exactly this number of characters is read. The result is converted and trimmed according to the <nType> parameter before being returned. In this case <nBytesRead> will have the value of <nStringLen> or 2 * <nStringLen> for Unicode text strings on return.
If <nType> is STRINGTYPE_TEXT, STRINGTYPE_UNICODETEXT or STRINGTYPE_BINARY0, only the characters up to and not including the string terminator are read. Core Library: cckptcor.lib / cckptcor.dll Header: StringTypes.ch CopyStringToMemory, SetCX, Character set conversion
|