-
-
Save EspressoCake/612c8fa45e6d608ec0811ef747cf1db7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For Bobby Cooke :) | |
sub returnIntegerFromArray { | |
local('@cArray'); | |
local('$cVal'); | |
local('$cIndex'); | |
$cVal = 0; | |
if ((size(@_) == 1) && (size($1) == 4)) { | |
@cArray = reverse($1); | |
foreach $cIndex (@cArray) { | |
$cVal = ($cVal << 8) + ($cIndex & 0xFF); | |
} | |
println("Array integer value: " . $cVal); | |
} | |
} | |
# Example mock data, view in "Script Console" | |
returnIntegerFromArray(@(214, 188, 3, 0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment