Position Method Example

The following program code demonstrates how to get the position of an item in a TMult variable:

procedure TForm1.Button1Click(Sender: TObject);
var
  Mult: TMult;
begin
  Mult := TMult.Create(Form1);          {Create Mult. Make Form1 its owner}
  Label1.Caption := 'The position of the ''Third'' element is ' +
     IntToStr(Mult.Postion('Third'));   {will be -1 since the list is empty}
  Mult['Second'] := 'Two';
  Label1.Caption := 'The position of the ''Third'' element is ' +
     IntToStr(Mult.Postion('Third'));   {will be -1 since 'Third' item does not exit}
  Label1.Caption := 'The position of the ''Second'' element is ' +
     IntToStr(Mult.Postion('Second'));  {will be 0, TMult positions start with 0}
end;