Difference between revisions of "RPC HELP TMult Order Example"

From VistApedia
Jump to: navigation, search
(Created page with "<h2>Order Example</h2> The following program code demonstrates how to get the next and previous elements in a TMult list: '''procedure''' TForm1.Button1Click(Sender: TOb...")
 
 
Line 1: Line 1:
 +
[[RPC_Broker_Help| RPC Broker Help Home]]
 +
[[RPC_HELP_Mult_Order|Back]]
 +
 
<h2>Order Example</h2>
 
<h2>Order Example</h2>
 +
 
The following program code demonstrates how to get the next and previous elements in a TMult list:
 
The following program code demonstrates how to get the next and previous elements in a TMult list:
 
 

Latest revision as of 23:20, 3 July 2015

RPC Broker Help Home Back

Order Example

The following program code demonstrates how to get the next and previous elements in a TMult list:

   procedure TForm1.Button1Click(Sender: TObject);
   var
     Mult: TMult;
     Subscript: string;
   begin
     {Create Mult. Make Form1 its owner}
     Mult := TMult.Create(Form1);
     Mult['First'] := 'One';
     {Store element pairs one by one}
     Mult['Second'] := 'Two';
     Mult['Third'] := 'Three';
     Mult['Fourth'] := 'Four';
     {Subscript will be Fourth}
     Subscript := Mult.Order('Third',1);
     {Subscript will be Second}
     Subscript := Mult.Order('Third',-1);
     {Subscript will be . THIRD subscript does not exist}
     Subscript := Mult.Order('THIRD',1);
     {Subscript will be First}
     Subscript := Mult.Order(,1);
     {Subscript will be Fourth}
     Subscript := Mult.Order(,-1);
   end;