Core Function BinaryCompare
From Sputnik Wiki
(Difference between revisions)
(Created page with "<pre> BinaryCompare( <binary-array>, <binary-array2> ) </pre> === Description === Compare two binary variables. === Parameters === ==== binary-array ==== The a binary variab...") |
(→Return Value) |
||
Line 19: | Line 19: | ||
=== Return Value === | === Return Value === | ||
− | + | -1 if binary1 is less than binary2 | |
− | + | 1 if binary1 is greater than binary2 | |
+ | |||
+ | 0 if they are equal. | ||
+ | |||
+ | NULL on error | ||
=== Remarks === | === Remarks === |
Revision as of 13:26, 27 September 2013
BinaryCompare( <binary-array>, <binary-array2> )
Contents |
Description
Compare two binary variables.
Parameters
binary-array
The a binary variable to use.
binary-array2
The a binary variable to use.
Return Value
-1 if binary1 is less than binary2
1 if binary1 is greater than binary2
0 if they are equal.
NULL on error
Remarks
None.
Example
my $Binary1 = Pack("z0", "Hello world!!!"); my $Binary2 = Pack("z0", "Hello world!!!"); If( BinaryCompare($Binary1, $Binary2) ) { println("Both binary variables contain the same data"); } Else { println("No match"); } println(""); println("Lets try again now now that one was changed"); my $Binary1 = Pack("z0", "Test"); If( BinaryCompare($Binary1, $Binary2) ) { println("Both binary variables contain the same data"); } Else { println("No match"); }