BinaryPokeStrW

Writes a Unicode string into a binary buffer.

Syntax:

BinaryPokeStrW( handle, offset, string [, reverse-bytes])

Parameters:

(i) handle: handle of buffer.

(i) offset: zero-based offset in the buffer to store string.

(s) string: string to store into buffer.

(i) reverse bytes: [optional] @FALSE default. @TRUE the bytes in each Unicode character are reversed from the normal byte order.

Returns:

(i)  number of bytes stored.

 

This function is used to write Unicode string data into a binary buffer. There must be sufficient space in the buffer between the offset and the allocated end of the buffer to accommodate the string. Each character in a Unicode-string requires 2 bytes in the buffer. The return value is the number of bytes written.

 

Example:


unicodestr = ChrHexToUnicode("480065006C006C006F00");Hello
bytecnt = StrByteCount ( unicodestr, 1)
buf = BinaryAlloc(bytecnt)
BinaryPokeStrW( buf, 0, unicodestr)
unicodestr = BinaryPeekStrW( buf, 0, bytecnt )
BinaryFree(buf)
Message("Unicode String", unicodestr)
See Also:

Binary Operations, BinaryCopy, BinaryPeek, BinaryPeekStr, BinaryPoke, BinaryPokeStr