home *** CD-ROM | disk | FTP | other *** search
- Program EX_0403;
- {Listing 7P - see documentation in TUTOR.SSS}
-
- uses SSS;
- { For Pascal other than Turbo/Quick erase above line }
-
- const
- ARRIVL = 1;
- STARTA = 2;
- ENDACT = 3;
-
- { For MS Pascal $include:'SSSP1.H' }
-
- var
- c, ecode : integer;
-
- { For MS Pascal $include:'SSSP2.H' }
-
- procedure prime;
- begin
- INIQUE(0,0,1);
- INISTA(1,'Occupancy',1,0,0,0);
- SIMEND(40.0);
- CREATE(0, 0);
- c := 0;
- TALLY(1,0);
- end;
-
- procedure leavec;
- begin
- c := c + 1;
- TALLY(1, c);
- SCHED(EX(20), ENDACT, 0);
- DISPOS;
- end;
-
- procedure pickc;
- begin
- c := c - 1;
- TALLY(1, c);
- DISPOS;
- end;
-
- begin
-
- prime;
-
- repeat
- ecode := NEXTEV;
- if ecode > 0 then
- begin
- case ecode of
-
- ARRIVL: begin
- CREATE(EX(2), 0);
- SCHED(0, STARTA, 0);
- end;
-
- STARTA: leavec;
-
- ENDACT: pickc;
-
- end;
- end;
- until ecode = 0;
-
- SUMRY('');
-
- end.