var P : TStackEl; begin memo1.lines.clear; P := S.StackTop; while P <> Nil do begin memo1.lines.add(P.el); P := P.prev; end; end;