RPC HELP TParams Assign Example

From VistApedia
Revision as of 01:26, 4 July 2015 by Kdtop (talk | contribs) (Created page with "Assign Example (TParams Class) The following program code demonstrates how a TParams assign method can be used to save off the TRPCB c...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Assign Example (TParams Class) The following program code demonstrates how a TParams assign method can be used to save off the TRPCB component parameters and restore them later:


   procedure TForm1.Button1Click(Sender: TObject);
   var
     SaveParams: TParams;
     SaveRemoteProcedure: string;
   begin
     {create holding variable with Form1 as owner}
     SaveParams := TParams.Create(self);
     {save parameters}
     SaveParams.Assign(brkrRPCBroker1.Param);
     SaveRemoteProcedure := brkrRPCBroker1.RemoteProcedure;
     brkrRPCBroker1.RemoteProcedure := 'SOME OTHER PROCEDURE';
     brkrRPCBroker1.ClearParameters := True;
     brkrRPCBroker1.Call;
     {restore parameters}
     brkrRPCBroker1.Param.Assign(SaveParams);
     brkrRPCBroker1.RemoteProcedure := SaveRemoteProcedure;
     {release memory}
     SaveParams.Free;
   end;