CopyStringToMemory - Transfer data from a string to memory |
Top Previous Next |
Syntax
<lRet> := CopyStringToMemory( <nAddress>, <cString>, [<nType>], [<nBufferSize>], [<nBytesWritten>] )
Parameters
<nAddress>
Target start address of string in memory.
<cString>
String to copy to the target address. In memory one 0-byte (STRINGTYPE_TEXT, STRINGTYPE_BINARY0) or two 0-bytes (STRINGTYPE_UNICODETEXT) are added. Strings of STRINGTYPE_BINARY are not terminated.
<nType>
Type of string data to be written to memory. This value can be STRINGTYPE_BINARY, STRINGTYPE_BINARY0, STRINGTYPE_TEXT, STRINGTYPE_UNICODETEXT. Specifying this parameter requests character set conversions while copying the string data. Default is STRINGTYPE_BINARY.
<nBufferSize>
Size (number of bytes) of buffer available for the string and it's terminator. This parameter can be omitted if you are sure there is enough buffer space available. At least Len(<cString>) bytes are required to accommodate binary strings and Len(<cString>)+1 bytes for text strings and the terminating 0-byte. Unicode strings require 2* Len(<cString>)+2 bytes of memory. If <nBufferSize> is specified, <cString> is truncated if necessary to fit the buffer including its terminator.
<nBytesWritten>
OUT: Number of bytes written during the operation.
Return value
Always .T.
Description
A string is written to memory starting at address <nAddress>. During the transfer to memory character set conversions can be requested with <nType>. The conversions available are:
In memory the string is terminated with one 0-byte (or two 0-bytes for Unicode strings). If a buffer size is specified, the string is truncated to fit into the buffer with termination.
Classification
Core
Category
Quick Info
Library: cckptcor.lib / cckptcor.dll Header: StringTypes.ch
See also
Example
|