Turtle-Graphiken IV

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

Hilbert.om
VAR level: INTEGER; out: Streams.Stream;

PROCEDURE ProcessArgs;
   VAR
      s: Streams.Stream; flag: CHAR;
      outfile: ARRAY 512 OF CHAR;
      errors: RelatedEvents.Object;
BEGIN
   NEW(errors); RelatedEvents.QueueEvents(errors);
   out := Streams.stdout;
   Args.Init("[-o outfile] [-X] level");
   WHILE Args.GetFlag(flag) DO
      CASE flag OF
      | "o":   
         Args.FetchString(outfile);
         IF ~UnixFiles.Open(out, outfile,
               UnixFiles.write + UnixFiles.create,
               Streams.onebuf, errors) THEN
            Conclusions.Conclude(errors, Errors.fatal, "");
         END;
      | "X":
         IF ~UnixPipes.Open(out,
               "/usr/local/bin/plot -l -T X",
               UnixPipes.write, Streams.onebuf, errors) THEN
            Conclusions.Conclude(errors, Errors.fatal, "");
         END;
      ELSE
         Args.Usage;
      END;
   END;
   Args.Fetch(s); Read.IntS(s, level); Args.AllArgs;
END ProcessArgs;

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]
Copyright © 1999, 2004 Andreas F. Borchert, in HTML konvertiert am 28.01.2005