Hello Dennis,

MSB is the high (Most) significant bit eg, the leftmost BIT not byte.
Regards,
Al+



Tuesday, October 29, 2002, 8:13:23 AM, you wrote:
DC> Message
DC> Is the MSB (Most significant byte) to the left or to the right?  If it is to
DC> the left,

DC>       ieventclass := (eventpack[3] and $F0) shr 4;
DC>       ieventflags := (eventpack[3] and $0C) shr 2;
DC>       iTmpSession1  := eventpack[3] and $03;

DC> If its to the right


DC>       ieventclass := (eventpack[0] and $F0) shr 4;
DC>       ieventflags := (eventpack[0] and $0C) shr 2;
DC>       iTmpSession1  := eventpack[0] and $03;

DC> Dennis.

DC> ----- Original Message -----
DC> From: Jeremy Coulter
DC> To: Multiple recipients of list delphi
DC> Sent: Sunday, October 27, 2002 9:47 PM
DC> Subject: [DUG]: Needs some help please


DC> Hi all.
DC> I need some help with something.
DC> I am trying to get some info out of a file that was created by someone else,
DC> and there IS some doumentation, BUT, I am not sure if I have got the below
DC> right.
DC> Here is info from the document :-

DC> 4 byte EventPack structure:
DC> xxxx0000 00000000 00000000 00000000 - event class   (4 bits)
DC> 0000xx00 00000000 00000000 00000000 - event flags   (2 bits)
DC> 000000xx xx000000 00000000 00000000 - event session (4 bits)
DC> 00000000 00xxxxxx 00000000 00000000 - event type    (6 bits)
DC> 00000000 00000000 xxxxxxxx xx000000 - event size    (10 bits)
DC> 00000000 00000000 00000000 00xxxxxx - event owner   (6 bits)

DC> I have figured it out like this :-

DC> //declaration :-
DC> var eventpack : arry[0..3] of byte;

DC> //read it eventpack from a memory stream
DC> oMemStream.ReadBuffer(EventPack, sizeof(EventPack));

DC> This is the bit I am not sure I have right :-

DC>       ieventclass := eventpack[0] and $F0;
DC>       ieventflags := eventpack[0] and $0C;
DC>       iTmpSession1  := (eventpack[0] and $03 ) shl 2;
DC>       iTmpSession2  := (eventpack[1] and $C0) shr 6;
DC>       ieventsession := iTmpSession1+ iTmpSession2;
DC>       ieventtype  := eventpack[1] and $3F;
DC>       ieventsize  :=(eventpack[2] * 4)+ ((eventpack[3] and $C0) shr 6);
DC>       ieventowner :=(eventpack[3] and $3F);

DC> Am I right? if not, can someone please guide me here?

DC> Thanks,

DC> Jeremy Coulter

DC> -------------------------------------------------------------------
DC> All email scanned with Nortons Antivirus 2002
DC> -------------------------------------------------------------------
DC> ---------------------------------------------------------------------------
DC>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
DC>                   Website: http://www.delphi.org.nz
DC> To UnSub, send email to: [EMAIL PROTECTED] 
DC> with body of "unsubscribe delphi"
DC> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/


-- 
Regards,
 Alistair+

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to