(* ------------------- VERSION 2 16.05.86 ------------------- *) PACKET multi user monitor DEFINES (* Autor: J.Liedtke *) monitor : LET command list = "edit:1.01run:4.01runagain:6.0insert:7.01forget:9.01rename:11.2copy:12.2 list:13.0storageinfo:14.0taskinfo:15.0 fetch:16.1save:17.01break:19.0saveall:20.0 " ; LET text param type = 4 ; INT VAR command index , number of params , previous heap size ; TEXT VAR param 1, param 2 ; lernsequenz auf taste legen ("q", ""1""8""1""12"break"13"") ; lernsequenz auf taste legen ("e", ""1""8""1""12"edit"13"") ; PROC monitor : disable stop ; previous heap size := heap size ; REP command dialogue (TRUE) ; sysin ("") ; sysout ("") ; cry if not enough storage ; get command ("gib kommando :") ; reset editor ; analyze command (command list, text param type, command index, number of params, param1, param2) ; execute command ; collect heap garbage if necessary PER . collect heap garbage if necessary : IF heap size > previous heap size + 10 THEN collect heap garbage ; previous heap size := heap size FI . cry if not enough storage : INT VAR size, used ; storage (size, used) ; IF used > size THEN out (""7"Speicher Engpass! Dateien loeschen!"13""10"") FI . reset editor : WHILE aktueller editor > 0 REP quit PER ; clear error . ENDPROC monitor ; PROC execute command : enable stop ; SELECT command index OF CASE 1 : edit CASE 2 : edit (param1) CASE 3 : (* war frueher paralleleditor *) CASE 4 : run CASE 5 : run (param1) CASE 6 : run again CASE 7 : insert CASE 8 : insert (param1) CASE 9 : forget CASE 10: forget (param1) CASE 11: rename (param1, param2) CASE 12: copy (param1, param2) CASE 13: list CASE 14: storage info CASE 15: task info CASE 16: fetch (param1) CASE 17: save CASE 18: save (param1) CASE 19: break CASE 20: save all OTHERWISE do command ENDSELECT . ENDPROC execute command ; ENDPACKET multi user monitor ;