Ausgabe-Prozeduren

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]

AddressBook2.om
PROCEDURE PrintEntry(entry: Entry);
   (* print an entry that is in use *)
BEGIN
   ASSERT(entry.used);
   Write.String(entry.name);
   IF entry.city # "" THEN
      Write.String(", ");
      Write.Line(entry.city);
   END;
END PrintEntry;

PROCEDURE PrintEntries(addressBook: AddressBook);
   (* print all used entries of the given address book *)
   VAR
      index: INTEGER;
BEGIN
   index := 0;
   WHILE index < maxentries DO
      IF addressBook[index].used THEN
         PrintEntry(addressBook[index]);
      END;
      INC(index);
   END;
END PrintEntries;

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]
Copyright © 2004, 2005 Andreas Borchert, in HTML konvertiert am 18.02.2005