"Sputnik" help  
Sputnik Help
BinaryWrite64BitCString(<binary>, <position>, <value>)

Description

Writes a 64-bit encoded C-style string to a binary array starting from the specified position.

Parameters

<binary> The binary array from which to write the string.
<position> The position in the binary array to start writing from.
<value> The string to write.

Return Value

Success: Returns true if the string was written properly.
Failure: Returns null if the position is out of bounds or an error occurs during writing..

Remarks

The BinaryWrite64BitCString function writes the 64-bit encoded characters of the string value to the binary array starting from the specified position. It appends a null terminator (eight zero bytes) at the end of the string in the binary array.

Related

BinaryRead64BitCString

Example

Example of usage:

my $a = BinNew(96);

BinaryWrite32BitCString($a, 0, "Cat");
BinaryWrite32BitCString($a, 32, "Dog");
BinaryWrite32BitCString($a, 64, "Fox");

say BinaryExpand($a, false);

say BinaryRead32BitCString($a, 0);
say BinaryRead32BitCString($a, 32);
say BinaryRead32BitCString($a, 64);

// PRINTS
// 43 00 00 00 61 00 00 00 74 00 00 00 00 00 00 00 C...a...t.......
// 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
// 44 00 00 00 6F 00 00 00 67 00 00 00 00 00 00 00 D...o...g.......
// 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
// 46 00 00 00 6F 00 00 00 78 00 00 00 00 00 00 00 F...o...x.......
// Cat
// Dog
// Fox

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org