"Sputnik" help  
Sputnik Help
Byte(<value>)

Description

Casts the selected value to an unsigned 8-bit integer.

Parameters

<value> The value to be casted to an unsigned 8-bit integer.

Return Value

Success: Returns the value casted to an unsigned 8-bit integer.
Failure: Returns 0 if the value cannot be converted within the scope of this function.

Remarks

This function is useful for explicitly converting a value to an unsigned 8-bit integer type.

Related

Casting, IsVarByte

Example

Example of usage:

my $result = Byte(42);
say $result;
// PRINTS
// 42

my $byteValue = Byte("127");
say $byteValue;
// PRINTS
// 127

my $nonByte = Byte("non-byte");
say $nonByte;
// PRINTS
// 0

Casting:

my $result = (Byte)42;
say $result;
// PRINTS
// 42

 


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