RPC HELP TMult First Example: Difference between revisions

From VistApedia
Jump to navigationJump to search
Created page with " RPC Broker Help Home <h2>First Example</h2> Back The following program code displays the subscript and value of the first item i..."
 
No edit summary
Line 1: Line 1:
[[RPC_Broker_Help| RPC Broker Help Home]]
[[RPC_Broker_Help| RPC Broker Help Home]]
<h2>First Example</h2>
<h2>First Example</h2>
[[RPC_HELP_Mult_Sorted|Back]]
[[RPC_HELP_TMult|Back]]


The following program code displays the subscript and value of the first item in a Mult variable in the caption of a label when the user clicks the GetFirst button:
The following program code displays the subscript and value of the first item in a Mult variable in the caption of a label when the user clicks the GetFirst button:

Revision as of 22:35, 3 July 2015

RPC Broker Help Home

First Example

Back

The following program code displays the subscript and value of the first item in a Mult variable in the caption of a label when the user clicks the GetFirst button:

   
   procedure TForm1.GetFirstClick(Sender: TObject);
   var
     Mult: TMult;
     Subscript: string;
   begin
     {Create Mult. Make Form1 its owner}
     Mult := TMult.Create(Form1);
     Mult['Fruit'] := 'Apple';
     {Store element pairs one by one}
     Mult['Vegetable'] := 'Potato';
     Label1.Caption := 'The subscript of the first element: ' + Mult.First + ', and its value: ' + Mult[Mult.First];
   end;