RPC HELP TMult Position Example

From VistApedia
Revision as of 23:28, 3 July 2015 by Kdtop (talk | contribs) (Created page with " RPC Broker Help Home <h2>Position Example</h2> Back The following program code demonstrates how to get the position of an item...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

RPC Broker Help Home

Position Example

Back

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
     {Create Mult. Make Form1 its owner}
     Mult := TMult.Create(Form1);
     Label1.Caption := 'The position of the Third element is ' +
     {will be -1 since the list is empty}
     IntToStr(Mult.Postion('Third'));
     Mult['Second'] := 'Two';
     Label1.Caption := 'The position of the Third element is ' +
     {will be -1 since 'Third' item does not exit}
     IntToStr(Mult.Postion('Third'));
     Label1.Caption := 'The position of the Second element is ' +
     {will be 0, TMult positions start with 0}
     IntToStr(Mult.Postion('Second'));
   end;