HP3000-L Archives

May 2002, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Michael Abootorab <[log in to unmask]>
Reply To:
Michael Abootorab <[log in to unmask]>
Date:
Wed, 15 May 2002 13:52:16 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (70 lines)
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 *

ATOM RSS1 RSS2