COMAL Syntax: C-64 / Version 0.14 Note: Items in brackets ([]) are optional. // -- allows comments in a program //[] ABS -- returns absolute value ABS() AND -- logical AND AND APPEND -- start at end of seq file OPEN [FILE] ,,APPEND ATN -- returns arctangent in radians ATN() AUTO -- automatic line numbering AUTO [][,] BASIC -- return to BASIC mode BASIC CASE -- multiple choice decisions CASE [OF] CAT -- disk catalog (directory) CAT [] CHAIN -- load & run program on disk CHAIN CHR$ -- returns CBM ASCII code; inverse of ORD CHR$() CLOSE -- closes files CLOSE [[FILE] ] CLOSE with no file # closes all open files CLOSED -- makes all proc/func variables local PROC [(params)] [CLOSED] FUNC [(params)] [CLOSED] CON -- continue program execution CON COS -- returns cosine (angle in radians) COS() DATA -- provides data for a READ DATA [,][,...] DEL -- deletes lines DEL DELETE -- deletes a file from disk DELETE DIM -- reserve/allocate string/array space DIM OF DIM () OF DIM () DIV -- division with integer answer DIV DO -- do the following statements DO EDIT -- list lines without indentations EDIT [] ELIF -- short for ELSE IF condition ELIF [THEN] ELSE -- alternative statements in IF structure ELSE END -- halt program execution END ENDCASE -- end of CASE structure ENDCASE ENDFOR -- end of FOR structure ENDFOR [] ENDFUNC -- end of function ENDFUNC [] ENDIF -- end of IF structure ENDIF ENDPROC -- end of procedure ENDPROC [] ENDWHILE -- end of WHILE structure ENDWHILE ENTER -- merge LISTed program segment from disk ENTER EOD -- End Of Data flag EOD EOF -- End Of File flag EOF() ESC -- stop key pressed flag ESC TRAP ESC EXEC -- execute a procedure [EXEC] [()] EXP -- returns e^n (e=base of natural logs=2.18281828459045+) EXP() FALSE -- predefined value = 0 FALSE FILE -- specifies file I/O is to be used INPUT FILE [,]: PRINT FILE [,]: READ FILE [,]: WRITE FILE [,]: OPEN [FILE] ,[,] CLOSE [[FILE] ] FOR -- start of FOR loop structure FOR := TO [STEP ] FUNC -- start of a multiline function FUNC [()] [CLOSED] GOTO -- go to line with this label GOTO