COMAL

COMAL (English common algorithmic language) is an imperative programming language of the third generation.

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

The language occupies a position between BASIC and Pascal and takes over from BASIC conceptually the ease of learning and the interactive operation, while control structures, functions, procedures and recursion from Pascal come.

The UniCOMAL implementation for DOS and OS / 2 has object orientation and allowed to expand user- defined language.

There are versions for the following computer architectures:

  • CP / M
  • Commodore PET 2001 ( Public Domain ), 64 ( Public Domain ) and 128
  • Commodore Amiga
  • Schneider / Amstrad CPC
  • Acorn 8-bit
  • Acorn Electron
  • Acorn 32-bit
  • IBM PC / AT ( DOS and OS / 2)
  • 32 -bit Windows ( OpenComal )
  • Unix ( BSD, GNU / Linux, MacOS X) ( OpenComal )
  • MS-DOS ( OpenComal )

Statements, commands and commands in COMAL

AUTO: During program entry, the program lines of computer numbered independently.

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 store parts of the program or programs so that they can be added later on in-memory program.

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

MERGE: Use this command to load programs into memory without deleting it before. If a program already exists in memory, so the new program is added to the already existing ones.

PAGE: This command clears the screen and moves the cursor to the upper left corner.

RENUM: Use this statement to create a new numbering of the program in increments of ten.

RUN: Use this command to start the program sequence.

SCAN: This statement allows a trial run without a program execution. It merely explains the program structure, and any errors are reported.

Examples

Conditions

10 IF number > 1000 THEN   20 PRINT "Your number is greater than 1000"   30 ELIF number <1000 THEN   40 PRINT "Your number is less than 1000"   50 ELSE   60 PRINT "Your number is 1000"   70 ENDIF grind

10 FOR number: = 1 TO 100 STEP 0.1 DO   20 PRINT number   30 ENDFOR   10 WHILE number < = 1000 DO   20 PRINT number   30 number: 1   40 ENDWHILE   10 REPEAT   20 PRINT number   30 number: 1   40 UNTIL number = 1000   10 LOOP   20 number: 1   30 EXIT WHEN number = 1001   40 PRINT number   50 ENDLOOP Example program 1

PAGE 10   20 FOR number: = 1 TO 10 DO   30 PRINT "It's fun to work with COMAL "   40 ENDFOR   50 END "" Sample Program 2

10 PRINT " sample program in the programming language COMAL "   20 REPEAT   25 EXEC write options   30 INPUT " Please select option " OPTION   40 INPUT " 1.Zahl: ": first   50 INPUT " 2.Zahl ": second   60 EXEC selection (OPTION, first, second )   70 UNTIL OPTION = 5   80 PROC write options   90 PRINT " 1 Total"   100 PRINT " second difference "   110 PRINT " third product"   120 PRINT " 4 quotient "   130 PRINT " 5 End"   140 ENDPROC write options   150 PROC selection (A, B, C)   160 A CASE OF   170 WHEN 1   175 PRINT " SUM = " B C   180 WHEN 2   185 PRINT " difference =", B -C   190 WHEN 3   195 PRINT " product = " B * C   200 WHEN 4   205 PRINT " ratio = " B / C   210 WHEN 5   215 PRINT " end "   220 OTHERWISE   225 PRINT " Wrong option "   230 ENDCASE   240 ENDPROC selection Sample Program 3

10 FOR z: = 1 TO 10 DO   20 PRINT " COMAL fun! "   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, pp. 179-192. doi: 10.1016/0360-1315 (82 ) 90031-8.
  • Borge R. Christensen, Heiko Wolgast: 00:14 COMAL Handbook, published by 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 lower secondary ) Klett, Stuttgart 1988, ISBN 3-12-718900-1
  • Hartmut Goehner, Bernd Hafenbrak: Workbook COMAL. Program examples of secondary school: drawing, maths, text and file processing. 2, durchges. Ed, Dümmler, Bonn 1988, ISBN 3-427-45302-2
  • Burkhard Leuschner: Comal 's the thing. In: System. 15, No. 3, 1987, pp. 373-376. doi: 10.1016/0346-251X (87 ) 90011 -X.
198447
de