home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / modula2 / 1015 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  2.5 KB

  1. Path: sparky!uunet!psgrain!puddle!f1.n3608.z1.fidonet.org!Joseph.Crea
  2. From: Joseph.Crea@f1.n3608.z1.fidonet.org (Joseph Crea)
  3. Sender: ufgate@puddle.fidonet.org (newsout1.26)
  4. Newsgroups: comp.lang.modula2
  5. Subject: Re: CODE! PLEASE!
  6. Message-ID: <17127.2A9006EB@puddle.fidonet.org>
  7. Date: Sat, 15 Aug 92 19:29:00 PST
  8. Organization: FidoNet node 1:3608/1 - 221B Baker St, Panama City FL
  9. Lines: 56
  10.  
  11. On 13-Aug-92, Jai Braatz was heard to plead to all:
  12.  
  13. JB> I've asked this here several times before, and I seem to never get
  14. JB> a response. Is it my end? Can someone post small but complete 
  15. pieces
  16. JB> of Modula-2 code (like a hello world program and something that
  17. JB> reads in numbers from a file or something) for me to look at as an
  18. JB> example? PLEASE?
  19.  
  20.   Hello, Jai!
  21.     You've wandered rather far afield from the C echo, haven't you?
  22. However, I won't hold your youthful indiscretions against you.
  23. Herewith is presented a Modula-2 equivalent to C's famous Hello, World
  24. program.
  25. --------------------------------------------------------------------
  26. MODULE Howdy;
  27. (*
  28.    A program to write a line of text to the console.  Uses libraries
  29.    and routines specified in Wirth's __Programming in Modula-2__,
  30.    third corrected edition, 1985, Springer-Verlag.
  31. *)
  32.  
  33.  
  34. FROM InOut IMPORT WriteString, WriteLn;
  35.  
  36. BEGIN
  37.   WriteString('Hello, World.'); WriteLn;
  38. END Howdy.
  39. --------------------------------------------------------------------
  40.  
  41.  
  42.   Although there is an ISO draft standard for Modula-2, I am aware of 
  43. only
  44. one compiler which currently supports it.  Therefore the program uses 
  45. the
  46. older "Wirth Standard" modules.  I would strongly suggest that you get
  47. a copy of K.N. King's  __Modula-2:  A Complete Guide__, which does an
  48. admirable job of introducing the vast majority of M2's features and
  49. quirks (sort of like Cooper & Clancy's  __Oh! Pascal!__ ).
  50.  
  51.   Last that I heard, Clarion (which purchased JPI earlier this year)
  52. still sold an educational version of JPI's TopSpeed Modula-2 for
  53. somewhere under $100.00.  The code generation isn't half bad, being
  54. much better than Turbo Pascal, and somewhat better than Turbo C's
  55. (version 2.0), although the code generator is being to show its age
  56. (especially against the latest versions of C compilers from Borland and
  57. Microsoft).  Next time, I'll whip up some code for file I/O.
  58.  
  59.   Hang in there and keep on programming!
  60.  
  61.                                         Joe Crea
  62.  
  63.  
  64. --  
  65. uucp: uunet!m2xenix!puddle!3608!1!Joseph.Crea
  66. Internet: Joseph.Crea@f1.n3608.z1.fidonet.org
  67.