Difference between revisions of "RPC HELP TRPCBroker Example"

From VistApedia
Jump to: navigation, search
(Created page with "<h2>TRPCBroker Example</h2> The following example demonstrates how a TRPCBroker component can be used to connect to the VistA M Server, execute various remote procedures, retu...")
 
(No difference)

Latest revision as of 14:15, 5 July 2015

TRPCBroker Example

The following example demonstrates how a TRPCBroker component can be used to connect to the VistA M Server, execute various remote procedures, return the results and finally disconnect from the server. This example assumes that a TRPCBroker component already exists on the form as brkrRPCBroker1:

   procedure TForm1.Button1Click(Sender: TObject);
   begin
     try
       {connect to the server}
       brkrRPCBroker1.Connected := True;
       //assign RPC name
       brkrRPCBroker1.RemoteProcedure := 'SOME APPLICATION RPC';
       {make the call}
       brkrRPCBroker1.Call;
       {display results}
       ListBox1.Items := brkrRPCBroker1.Results;
       {disconnect from the server}
       brkrRPCBroker1.Connected := False;
     except
       //put error handling code here
     end;
   end;