Unit unit1;
Interface
Uses
Windows, messages, sysutils, variants, classes, graphics, controls, forms,
Dialogs, stdctrls;
Type
Tform1 = Class (tform)
Button1: tbutton;
Procedure button1click (Sender: tobject );
End;
VaR
Form1: tform1;
Implementation
{$ R *. DFM}
Uses generics. collections;
Procedure tform1.button1click (Sender: tobject );
VaR
Queue: tqueue <string>;
S, STR: string;
Begin
Queue: = tqueue <string>. Create ();
{Column}
Queue. enqueue ('aaa ');
Queue. enqueue ('bbb ');
Queue. enqueue ('ccc ');
Queue. enqueue ('ddd ');
{View}
STR: = '';
For s in queue do STR: = STR + S + '';
Showmessage (STR); {aaa bbb ccc ddd}
{Column and View column elements}
Showmessage (queue. dequeue); {AAA}
STR: = '';
For s in queue do STR: = STR + S + '';
Showmessage (STR); {bbb ccc ddd}
{View which of the following columns will be output}
Showmessage (queue. Peek); {BBB}
Queue. Free;
End;
End.