🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #521

Re: CODE! PLEASE!

#521
From: Joseph Crea
Date: Sun, 16 Aug 1992 03:29
56 lines
2579 bytes
On 13-Aug-92, Jai Braatz was heard to plead to all:
 
JB> I've asked this here several times before, and I seem to never get
JB> a response. Is it my end? Can someone post small but complete 
pieces
JB> of Modula-2 code (like a hello world program and something that
JB> reads in numbers from a file or something) for me to look at as an
JB> example? PLEASE?
 
  Hello, Jai!
    You've wandered rather far afield from the C echo, haven't you?
However, I won't hold your youthful indiscretions against you.
Herewith is presented a Modula-2 equivalent to C's famous Hello, World
program.
--------------------------------------------------------------------
MODULE Howdy;
(*
   A program to write a line of text to the console.  Uses libraries
   and routines specified in Wirth's __Programming in Modula-2__,
   third corrected edition, 1985, Springer-Verlag.
*)
 
 
FROM InOut IMPORT WriteString, WriteLn;
 
BEGIN
  WriteString('Hello, World.'); WriteLn;
END Howdy.
--------------------------------------------------------------------
 
 
  Although there is an ISO draft standard for Modula-2, I am aware of 
only
one compiler which currently supports it.  Therefore the program uses 
the
older "Wirth Standard" modules.  I would strongly suggest that you get
a copy of K.N. King's  __Modula-2:  A Complete Guide__, which does an
admirable job of introducing the vast majority of M2's features and
quirks (sort of like Cooper & Clancy's  __Oh! Pascal!__ ).
 
  Last that I heard, Clarion (which purchased JPI earlier this year)
still sold an educational version of JPI's TopSpeed Modula-2 for
somewhere under $100.00.  The code generation isn't half bad, being
much better than Turbo Pascal, and somewhat better than Turbo C's
(version 2.0), although the code generator is being to show its age
(especially against the latest versions of C compilers from Borland and
Microsoft).  Next time, I'll whip up some code for file I/O.
 
  Hang in there and keep on programming!
 
                                        Joe Crea


--  
uucp: uunet!m2xenix!puddle!3608!1!Joseph.Crea
Internet: Joseph.Crea@f1.n3608.z1.fidonet.org
Technical Details
Message-ID: <17127.2A9006EB@puddle.fidonet.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!psgrain!puddle!f1.n3608.z1.fidonet.org!Joseph.Crea

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!psgrain!puddle!f1.n3608.z1.fidonet.org!Joseph.Crea
From: Joseph.Crea@f1.n3608.z1.fidonet.org (Joseph Crea)
Sender: ufgate@puddle.fidonet.org (newsout1.26)
Newsgroups: comp.lang.modula2
Subject: Re: CODE! PLEASE!
Message-ID: <17127.2A9006EB@puddle.fidonet.org>
Date: Sat, 15 Aug 92 19:29:00 PST
Organization: FidoNet node 1:3608/1 - 221B Baker St, Panama City FL
Lines: 56