comp.lang.ada
 help / color / mirror / Atom feed
From: jerry@jvdsys.nextjk.stuyts.nl (Jerry van Dijk)
Subject: Re: Please help link list!
Date: 1997/12/05
Date: 1997-12-05T00:00:00+00:00	[thread overview]
Message-ID: <881301956.91snx@jvdsys.nextjk.stuyts.nl> (raw)
In-Reply-To: 01bd0074$856c1020$8d484893@default


In article <01bd0074$856c1020$8d484893@default> sabo@HHS.NET writes:

>What am I doing wrong with this program?

Three remarks up-front:

1) Disable HTML in your mailer, as this is very hard to read using an
   ascii based mailer

2) Use one of the standard Ada styles for writing code, this makes it
   much more readable for others

3) GNAT.IO is a gnat specific package, use the language standard IO
   packages

Technically speaking you are doing nothing wrong with the program, when
compiled it does exactly what you instructed it to do.

Probably you mean it is not doing what you intended it to do. As this
looks like an assigment, best thing to do is ask you instructor for
help.

If your assignment is to program a linked list, this is coming quite
close, but the program contains several logic errors.

A old-fashioned technique I find very useful for finding errors like
this is to print out the program, take a blank sheet of paper, and
execute it yourself.

That is, write down the variables starting values, enter a number,
follow the program, writing down the new values of the variables as they
are updated. After a few iterations, check if the values the variables
are assigned to are what you expected them to be.

--

-- Jerry van Dijk | Leiden, Holland
-- Consultant     | Team Ada
-- Ordina Finance | jdijk@acm.org




  reply	other threads:[~1997-12-05  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-04  0:00 Please help link list! Eric Sabo
1997-12-05  0:00 ` Jerry van Dijk [this message]
1997-12-05  0:00 ` bklungle
replies disabled

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