"Sputnik" help  
Sputnik Help
BinaryClone(<binary>)

Description

Creates a clone of the given binary string.

Parameters

<binary> The binary string to be cloned.

Return Value

Success: Returns a new binary string that is an exact copy of the original..
Failure: Returns an empty binary string.

Remarks

The BinaryClone function creates a deep copy of the specified binary string or value. It ensures that any modifications made to the cloned binary string do not affect the original. If the input is not a valid binary string, it will be converted to a binary string representation.

Related

BinaryCloneTo, Clone, StrClone

Example

Basic example:

my $binary = (Binary)"Hello";
my $clone = BinaryClone($binary);
$clone[0] = 'T';
printr $binary;
printr $clone;
// PRINTS
// Binary
// (
//     [0] => 0x48 [72] (H)
//     [1] => 0x65 [101] (e)
//     [2] => 0x6C [108] (l)
//     [3] => 0x6C [108] (l)
//     [4] => 0x6F [111] (o)
// )
// Binary
// (
//     [0] => 0x54 [84] (T)
//     [1] => 0x65 [101] (e)
//     [2] => 0x6C [108] (l)
//     [3] => 0x6C [108] (l)
//     [4] => 0x6F [111] (o)
// )

It is possible to use the Clone function too:

my $binary = (Binary)"Hello";
my $clone = Clone($binary);
$clone[0] = 'T';
printr $binary;
printr $clone;
// PRINTS
// Binary
// (
//     [0] => 0x48 [72] (H)
//     [1] => 0x65 [101] (e)
//     [2] => 0x6C [108] (l)
//     [3] => 0x6C [108] (l)
//     [4] => 0x6F [111] (o)
// )
// Binary
// (
//     [0] => 0x54 [84] (T)
//     [1] => 0x65 [101] (e)
//     [2] => 0x6C [108] (l)
//     [3] => 0x6C [108] (l)
//     [4] => 0x6F [111] (o)
// )

 


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