Professional Documents
Culture Documents
Libreria Pidd
Libreria Pidd
simple array based Turbo Pascal Executive. This program uses the other
Procedure Aphase;
{Time scan by examining the Details array of records. Checks all entities
for which Avail is false. For these, finds those with the smallest timecells
Begin
NumCurrEnts := 0;
Minm := MaxInt;
With Details[Entity] do
Begin
Begin
Minm := TimeCell;
CurrEntArray[NumCurrEnts] := Entity;
End;
End;
PrevClock := Clock;
Clock := Minm;
End;
Procedure Bphase;
{Works through the CurrEntArray. For each entity number stored in CurrEntArray,
executes the B activity indicated for that entity. Executed after A phase
Begin
If TraceOn then
Begin
Writeln(TraceFile);
End;
ShowEntDetails;
Begin
CurrEnt := CurrEntArray[Loop];
With Details[CurrEnt] do
Begin
Avail := True; {Release CurrEnt}
End;
End;
End;
Procedure Cphase;
Begin
Repeat
CStarted := False;
End;
Initialisation;
Begin
Aphase;
Bphase;
Cphase;
UpDateScreen;
ScreenDelay;
CheckInterrupt;
End;
Finalisation;
End.
{Contains the global variables required by the simple array based Turbo
As procedural types are used, the compilation must force far calls, hence
CAct = Procedure;
End;
Activity : BAct;
RTime : Real);
Begin
With Details[Entity] do
Begin
Nextact := Activity;
Avail := False;
End;