"Sputnik" help  
Sputnik Help
BinarySetRange(<binary>, <value>, <start>, [<length>])

Description

Sets a range of bytes in the binary string to the specified byte value.

Parameters

<binary> The binary string in which to set the range of bytes.
<value> The byte value (an integer) to set in the specified range.
<start> The starting index of the range. The index starts from 0.
<length> Optional length of the range. If not provided, the range will extend to the end of the binary string.

Return Value

Success: Returns true.
Failure: Returns false.

Remarks

The BinarySetRange function allows you to set a range of bytes within a binary string to a specific value. It takes a binary string, a byte value, a start index, and an optional length as input. The start index indicates the starting position of the range, and the length specifies the number of bytes in the range. If the length is not provided, the range will extend to the end of the binary string. This function is useful when you need to update a specific range of bytes within a binary string.

Related

BinaryGetRange

Example

Example of usage:

my $a = Bin('A' rr 'Z');
BinarySetRange($a, '7', 3, 4);
say $a;
// PRINTS
// ABC7777HIJKLMNOPQRSTUVWXYZ

 


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