"Sputnik" help  
Sputnik Help
BinaryGet(<binary>, <index>

Description

Retrieves the byte value at the specified index in the binary string.

Parameters

<binary> The binary string from which to retrieve the byte value.
<index> The index of the byte to retrieve. The index starts from 0.

Return Value

Success: Returns the byte value (an integer) at the specified index in the binary string
Failure: Returns 0.

Remarks

The BinaryGet function allows you to access individual bytes within a binary string. It takes a binary string and an index as input and returns the byte value at that index. The index starts from 0, where 0 represents the first byte of the binary string. This function is useful when you need to retrieve specific byte values for further processing or manipulation.

Related

BinarySet

Example

Example get/set binary data:

my $binary = Bin("Cat");
BinarySet($binary, 0, 65);
BinarySet($binary, 2, 87);
say (Char)BinaryGet($binary, 0);
say BinaryGet($binary, 1);
say (Char)BinaryGet($binary, 2);
say $binary;
// PRINTS
// A
// 97
// W
// AaW

 


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