comp.lang.ada
 help / color / mirror / Atom feed
* Record help
@ 2002-05-29  2:39 tr4ck
  2002-05-29  5:31 ` Simon Wright
  2002-05-29  9:57 ` Robert Dewar
  0 siblings, 2 replies; 4+ messages in thread
From: tr4ck @ 2002-05-29  2:39 UTC (permalink / raw)


Say you have a record, which gets its data from a file.

TYPE Data IS RECORD
    No      : Integer;
    Name  : String(1..20);
  END RECORD;
Info: Array (1..10) OF Data;

When you display the record you get:
1111 SomeName
1111 SomeName
1111 SomeName

How is it possible to display just 1 line of 1111 SomeName instead of 3
(Assuming the file has the same info 3 times)?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Record help
  2002-05-29  2:39 Record help tr4ck
@ 2002-05-29  5:31 ` Simon Wright
  2002-05-29 17:54   ` Mike Silva
  2002-05-29  9:57 ` Robert Dewar
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Wright @ 2002-05-29  5:31 UTC (permalink / raw)


"tr4ck" <tr4ck@rediffmail.com> writes:

> Say you have a record, which gets its data from a file.
> 
> TYPE Data IS RECORD
>     No      : Integer;
>     Name  : String(1..20);
>   END RECORD;
> Info: Array (1..10) OF Data;
> 
> When you display the record you get:
> 1111 SomeName
> 1111 SomeName
> 1111 SomeName
> 
> How is it possible to display just 1 line of 1111 SomeName instead of 3
> (Assuming the file has the same info 3 times)?

By writing code to check whether "this" value is the same as the
"previous" value?

Seriously, you've given us so little context that we can't help
you. What does "gets its data from a file" mean? what does "display"
mean?

If this is a student project, ask your teachers.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Record help
  2002-05-29  2:39 Record help tr4ck
  2002-05-29  5:31 ` Simon Wright
@ 2002-05-29  9:57 ` Robert Dewar
  1 sibling, 0 replies; 4+ messages in thread
From: Robert Dewar @ 2002-05-29  9:57 UTC (permalink / raw)


"tr4ck" <tr4ck@rediffmail.com> wrote in message news:<YbXI8.154473$xS2.12590841@news1.calgary.shaw.ca>...

> How is it possible to display just 1 line of 1111 SomeName instead of 3
> (Assuming the file has the same info 3 times)?

program an appropriate test to remove the duplicates.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Record help
  2002-05-29  5:31 ` Simon Wright
@ 2002-05-29 17:54   ` Mike Silva
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Silva @ 2002-05-29 17:54 UTC (permalink / raw)


Simon Wright <simon@pushface.org> wrote in message news:<x7vofezldux.fsf@pushface.org>...
> "tr4ck" <tr4ck@rediffmail.com> writes:
> 
> > Say you have a record, which gets its data from a file.
> > 
> > TYPE Data IS RECORD
> >     No      : Integer;
> >     Name  : String(1..20);
> >   END RECORD;
> > Info: Array (1..10) OF Data;
> > 
> > When you display the record you get:
> > 1111 SomeName
> > 1111 SomeName
> > 1111 SomeName
> > 
> > How is it possible to display just 1 line of 1111 SomeName instead of 3
> > (Assuming the file has the same info 3 times)?
> 
> By writing code to check whether "this" value is the same as the
> "previous" value?
> 
> Seriously, you've given us so little context that we can't help
> you. What does "gets its data from a file" mean? what does "display"
> mean?

Also, what does "the same info" mean?  Seriously, is "1111 somename"
the same?  Is "1111 Some Name" the same?  Is "1111 Some J. Name" the
same?  For a school assignment you may just be working with "nice"
data, but just be aware that in the real world "the same" can be a
very a messy concept!

Good luck!

Mike



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-05-29 17:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-29  2:39 Record help tr4ck
2002-05-29  5:31 ` Simon Wright
2002-05-29 17:54   ` Mike Silva
2002-05-29  9:57 ` Robert Dewar

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