Hi,
you need to write a function that loops thru the packed decimal number
and does something like
$HEX_CHAR = '0123456789ABCDEF';
each bytes represents 2 decimal digits and last nibble indictates the sign.
foreach chars in packed decimal do
$high[$i] = $s[$i] >>4;
$low[$i] = $s[$i] & 0x0F;
$dechigh[$i] = substr($HEX_CHAR, $high[$i], 1);
$declow[$i] = substr($HEX_CHAR, $low[$i], 1);
$number .= $dechigh[$i].$declow[$i];
;done
$s[i] :: character in packed decimal
you also need to examine if $number is +ve or -ve.
thanks
Michael
On Wed, 15 May 2002 10:01:27 -0700, Braun Brelin <[log in to unmask]> wrote:
>Folks,
>
>I should add that I'm using the MPE::IMAGE perl module
>and that the packed unsigned fields are six bytes(?)
>in length.
>
>Basically, the code sample looks like this:
>
>$string = DbGet($db,2,$dataset);
>print "string = $string\n";
>
>Output looks like this:
>
>string = 010Ea?1 0Ea?1 01098041521 01UR01V
>9001PATHOLOGY SIGAE327115000000168
> RAæ±Ý 7007 1h
> 1 1LEFT FOOT
> 19960118000000
>
> ` q / 00
> 109960123090300
>
>-----------------------------------------------------
>
>Anybody have any recommendations?
>
>Thanks
>
>Braun Brelin
>[log in to unmask]
>
>
>__________________________________________________
>Do You Yahoo!?
>LAUNCH - Your Yahoo! Music Experience
>http://launch.yahoo.com
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|