Sha256: 7c483cd28f5e6332188584719edda818f161032feac528d284fc360b781dab7a
Contents?: true
Size: 913 Bytes
Versions: 10
Compression:
Stored size: 913 Bytes
Contents
MODULE Hello; IMPORT InOut; BEGIN InOut.WriteString('Hello world!'); InOut.WriteLn END Hello. ==={{header|TopSpeed Modula-2}}=== {{works with|TopSpeed (JPI) Modula-2 under DOSBox-X}} Modula-2 does not have built-in procedures for I/O. Instead, I/O is done via library modules. The names and contents of these modules vary between implementations of Modula-2. The solution below shows that the console I/O module supplied with TopSpeed Modula-2 has a different name and different procedures from the implementation in the previous solution. MODULE Hello; IMPORT IO; BEGIN IO.WrStr('Hello world!'); IO.WrLn; (* Another way, showing some features of Modula-2 *) IO.WrStr("Hello"); (* either single or double quotes can be used *) IO.WrChar(40C); (* character whose ASCII code is 40 octal *) IO.WrStr('world!'); IO.WrLn(); (* procedure with no arguments: () is optional *) END Hello.
Version data entries
10 entries across 7 versions & 1 rubygems