Core Function BinaryLen

From Sputnik Wiki
Revision as of 00:45, 12 November 2011 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
BinaryLen( <binary-array> )

Contents

Description

Returns the number of bytes in a binary variable.

Parameters

binary-array

The binary variable to evaluate.

Return Value

Success: Returns the length of the binary data in bytes.

Failure: Returns -1.

Remarks

UBound works just as good for this.

Example

$binary = BinaryHex("48656c6c6f20576f726c6421")
println( "Binary HEX: '" . BinaryStr($binary, ",") . "'" )
println("The binary size is: " . BinaryLen($binary) )
For $i In $binary
	println( "Byte: " . $i . " | Hex: " . Hex($i) . " | Char: " . Chr($i) )
Next
$String = Unpack("z0", $binary)
println("Full string: " . $String)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox