COMAL

from Wikipedia, the free encyclopedia
COMAL
Paradigms : structured
Publishing year: 1973
Developer: Benedict Løfstedt and Børge R. Christensen
Typing : strict
Dialects: UniCOMAL
Influenced by: BASIC , Pascal

COMAL ( engl. Com mon a lgorithmic l anguage ) is an imperative programming language of the third generation .

It was developed in 1973 by the Danes Benedict Løfstedt and Børge Christensen and was mainly aimed at programming beginners. COMAL was further developed at European universities, among others, and standardized as COMAL-80 in 1979.

The language takes a position between BASIC and Pascal and conceptually takes over from BASIC the easy learnability and the interactive way of working, while control structures , functions , procedures and recursion come from Pascal.

The UniCOMAL implementation for DOS and OS / 2 is an object-oriented programming language and allows user-defined extensions.

There are implementations for the following computer architectures:

Instructions, commands and commands in COMAL

AUTO:
While the program is being entered, the computer automatically numbers the program lines.

DEL:
This command is used when deleting procedures and program lines.

LIST:
With this command all program lines are displayed on the screen.

LIST":
This command is used to save program parts or programs in such a way that they can later be added to programs in memory.

LOAD:
With this command you read a copy of a program from the external memory into the working memory . If a program already exists in the main memory, it will be deleted.

MERGE:
With this command you load programs into the working memory without deleting it first. If a program already exists in the main memory, the new program is added to the existing one.

PAGE:
This command clears the screen and places the cursor in the upper left corner.

RENUM:
With this instruction you ensure that the program is renumbered in steps of ten.

RUN:
With this command you start the program sequence.

SCAN:
This instruction enables a test run without executing a program. Only the program structure is explained and any errors are reported.

Examples

conditions

 10 IF zahl > 1000 THEN
 20   PRINT "Ihre Zahl ist größer als 1000"
 30 ELIF zahl < 1000 THEN
 40   PRINT "Ihre Zahl ist kleiner als 1000"
 50 ELSE
 60   PRINT "Ihre Zahl ist 1000"
 70 ENDIF

grind

 10 FOR zahl:= 1 TO 100 STEP 0.1 DO
 20   PRINT zahl
 30 ENDFOR

 10 WHILE zahl <= 1000 DO
 20   PRINT zahl
 30   zahl:+1
 40 ENDWHILE

 10 REPEAT
 20   PRINT zahl
 30   zahl:+1
 40 UNTIL zahl = 1000

 10 LOOP
 20   zahl:+1
 30   EXIT WHEN zahl = 1001
 40   PRINT zahl
 50 ENDLOOP

Sample program 1

 10 PAGE
 20 FOR zahl:= 1 TO 10 DO
 30   PRINT "Es macht Spaß, mit COMAL zu arbeiten."
 40 ENDFOR
 50 END " "

Sample program 2

 10  PRINT "Beispielprogramm in der Programmiersprache COMAL"
 20  REPEAT
 25    EXEC writeoptions
 30    INPUT "Bitte Option wählen": Option
 40    INPUT "1.Zahl: ": first
 50    INPUT "2.Zahl: ": second
 60    EXEC auswahl(Option, first, second)
 70  UNTIL Option=5
 80  PROC writeoptions
 90    PRINT "1. Summe"
 100   PRINT "2. Differenz"
 110   PRINT "3. Produkt"
 120   PRINT "4. Quotient"
 130   PRINT "5. Ende"
 140 ENDPROC writeoptions
 150 PROC auswahl(A,B,C)
 160   CASE A OF
 170     WHEN 1
 175        PRINT "SUMME=", B+C
 180     WHEN 2
 185        PRINT "Differenz=", B-C
 190     WHEN 3
 195        PRINT "Produkt=", B*C
 200     WHEN 4
 205        PRINT "Quotient=", B/C
 210     WHEN 5
 215        PRINT "Ende"
 220     OTHERWISE
 225        PRINT "Falsche Option"
 230   ENDCASE
 240 ENDPROC auswahl

Sample program 3

 10  FOR z:= 1 TO 10 DO
 20    PRINT "COMAL macht Spaß!"
 25  ENDFOR z
 30  END ""

literature

  • Roy Atherton: Structured programming with COMAL. Horwood, Chichester 1982, ISBN 0-85312-416-7 .
  • MA Bramer: COMAL 80 - Adding structure to BASIC . In: Computers & Education . 6, No. 2, 1982, ISSN  0360-1315 , pp. 179-192. doi : 10.1016 / 0360-1315 (82) 90031-8 .
  • Borge R. Christensen, Heiko Wolgast: COMAL 0.14 manual . Verlag Schmidt & Klaunig, Kiel 1984
  • Borge R. Christensen: Structured programming with COMAL 80 . Oldenbourg Verlag, Munich 1985, ISBN 3-486-26902-X
  • Andreas Fischer: COMAL. (Computer science in secondary level I.) Klett, Stuttgart 1988, ISBN 3-12-718900-1
  • V. Fischer: COMAL in examples , 1st edition, BG Teubner Verlag 1986, ISBN 978-3-519-02538-2
  • Hartmut Göhner, Bernd Hafenbrak: COMAL workbook. Program examples for secondary level I: drawing, arithmetic, text and File editing. 2., through Ed. Duemmler, Bonn 1988, ISBN 3-427-45302-2
  • Burkhard Leuschner: Comal's the thing . In: System . 15, No. 3, 1987, ISSN  0346-251X , pp. 373-376. doi : 10.1016 / 0346-251X (87) 90011-X .
  • UniComal A / S Denmark: UniComal ver.3 Programming System for DOS OS / 2 Reference. UC 09.93, 511 pages, September 1993
  • UniComal A / S Denmark: UniComal ver 3 Programming System for DOS OS / 2 Development Toolkit. UC 09.93, 394 pages, September 1993

Web links

Individual evidence

  1. a b Fritz Nestle, Dietrich Pohlmann: C64 / 128 COMAL 80 programming practice. Haar near Munich: Market + Technology (1987)