comp.lang.ada
 help / color / mirror / Atom feed
From: "mop" <mop65715@pegasus.cc.ucf.edu>
Subject: Computing checksum for Ada newbie
Date: Tue, 28 Aug 2001 11:11:47 -0400
Date: 2001-08-28T11:11:47-04:00	[thread overview]
Message-ID: <9mgcbl$49b$1@zeus.orl.lmco.com> (raw)

I've got two types - we'll call them TYPE_1, TYPE_2.

The checksum (last byte) for TYPE_1 is the byte eight.
The checksum (last byte) for TYPE_2 varies (depends on user parameters)  but
the threshold is byte 517.
The checksum is a simple sum of the the bytes (dont care about overflow)
An example of TYPE_1 is provided.  "BYTE" is defined in my package.

type TYPE_1 is
record
 XX             :  BYTE;  -- first byte
 YY             :  BYTE;  -- second byte
-- etc
 Checksum  :  BYTE;  -- eighth byte
end record;

I want a function - we'll call it Compute_Checksum that'll sum the bytes

function Compute_Checksum return BYTE is  -- dont think this is right.  need
to pass in which type
   INTEGER : Checksum :=0;
begin
-- more help here
end Compute_Checksum;





             reply	other threads:[~2001-08-28 15:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-28 15:11 mop [this message]
2001-08-28 16:43 ` Computing checksum for Ada newbie tmoran
2001-08-29  8:46 ` John McCabe
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox