PageRenderTime 20ms CodeModel.GetById 18ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/fcl-stl/doc/stackexample.pp

https://github.com/slibre/freepascal
Puppet | 17 lines | 13 code | 4 blank | 0 comment | 2 complexity | 9e0beb219744991fa7c142fe8973addf MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
 1uses gstack;
 2
 3type stacklli = specialize TStack<longint>;
 4
 5var data:stacklli; i:longint;
 6
 7begin
 8  data:=stacklli.Create;
 9  for i:=1 to 10 do
10    data.Push(10*i);
11  while not data.IsEmpty do begin
12    writeln(data.Top);
13    data.Pop;
14  end;
15
16  data.Destroy;
17end.