Now that you have created and tested the ZxxxTT LIST RPC on the M server system, you can use your Delphi application's TRPCBroker component to call that RPC.
To call the ZxxxTT LIST RPC from your Delphi application to populate a list box:
a. Set RCPBroker1's RemoteProcedure property to ZxxxTT LIST.
b. Call RPCBroker1's Call method (in a try...except exception handler block) to invoke that RPC.
c. Retrieve results from RPCBroker1's Results property, setting them one-by-one into the list box's Items property.
This code should look as follows:
Procedure TForm1.Button1Click(Sender: TObject); var i:integer; begin RPCBroker1.RemoteProcedure:='ZxxxTT LIST'; try begin {call} RPCBroker1.Call; for i:=0 to (RPCBroker1.Results.Count-1) do ListBox1.Items.Add(piece(RPCBroker1.Results[i],'^',2)); end; {call} except On EBrokerError do ShowMessage('A problem was encountered communicating with the server.'); end; {try}
end;
Now that you can retrieve a list of terminal type entries, the next logical task is to retrieve a particular entry when a user selects that entry in the list box.