comp.lang.ada
 help / color / mirror / Atom feed
* Searching for an object
@ 2000-08-18  0:00 Matthias Teege
  2000-08-21  0:00 ` Ted Dennison
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Matthias Teege @ 2000-08-18  0:00 UTC (permalink / raw)



Moin,

I've defined the following type: 

type customer is record
   aname  : String( 1..25);
   bname  : String( 1..25);
end record;

Then I create some objects of this type and save all of
them in an table.

Now I want to find a special object with a find procedure
like this (not authentic Ada Code :-)):

procedure find ( Field : in String;
                 What  : in String;
                 Result: out String) is

while end_of_table is false loop
  read(object);
  if object.Field = What then -- field should be 'aname'
                              -- or 'bname'
     Result := object.Field;
     exit; -- We have found it
  end if
end loop;
end find;

I want to search in all Record "Fields" depend on the
procedure parameter.

How is the Ada way?

Many thanks
Matthias

-- 
Matthias Teege -- matthias@mteege.de -- http://emugs.de
make world not war
PGP-Key auf Anfrage





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

end of thread, other threads:[~2000-08-31 21:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-18  0:00 Searching for an object Matthias Teege
2000-08-21  0:00 ` Ted Dennison
2000-08-21  0:00   ` Matthias Teege
2000-08-21  0:00     ` tmoran
2000-08-22  0:00       ` Matthias Teege
2000-08-22  0:00         ` tmoran
2000-08-21  0:00     ` Ted Dennison
2000-08-21  0:00 ` Gerald Kasner
2000-08-21  0:00   ` Matthias Teege
2000-08-31 21:55 ` John McCabe

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