procedure MostRecentTemperature
(
var stack: STACK_TYPE;
var Temperature: 1..100000
)
begin
/ get most recent temperature from top of stack /
Temperature :=StackTemperature[Stack.Top]
StackTemperature[Stack.Top] :=INITAL_TEMPERATURE;
if(Stack.Top>0) then
begin
Stack.Top:=Stack.Top-1
end
end;
AllowableTemperature:=MaxAllowableTemperature(Environment)
MostRecentTemperature(Stack,Temperature);
if(Temperature>AllowableTemperature) then
begin
ShutdownReactor(Enviromentm,Temperature)
end;
...