Example The program code in Figure 29 displays the subscript and value of the last item in a Mult variable in the caption of a label when the user clicks the GetLast button: Figure : Last Property—Example procedure TForm1.GetLastClick(Sender: TObject); var Mult: TMult; Subscript: string; begin {Create Mult. Make Form1 its owner} Mult := TMult.Create(Form1); Mult[‘Fruit’] := ‘Apple’; element pairs one by one} Mult[‘Vegetable’] := ‘Potato’; Label1.Caption := subscript of the last element: + Mult.Last + and its ‘The ’ ‘, value: + Mult[Mult.Last]; ’ end; ListenerPort Property Applies to TRPCBroker Component Declaration property Integer; ListenerPort: Description The ListenerPort design-time property the developer the ability to select the Listener port on the VistA M Server. It be set connecting to the server. must always before If one M Server system has two or more environments (UCIs) that support client/server applications (e.g., Test and Production accounts), the Broker Listener processes be listening on unique ports. must Thus, you specify which Listener port to use when you start the Listener on the VistA M Server. must Consequently, if you have more than one Listener running on the same server, the application needs to specify the correct Listener for its connection request. This is accomplished using the ListenerPort property. After the initial connection, the VistA M Server connection is moved to another port number [i.e., Socket Property (read-only)], which is used for the remainder of the session. Example The program code in Figure 30 demonstrates using the ListenerPort Property: Figure : ListenerPort Property—Example procedure TForm1.btnConnectClick(Sender: TObject); brkrRPCBroker1.ListenerPort := 9001; brkrRPCBroker1.Connected := True; end;
Example The program code in Figure 29 displays the subscript and value of the last item in a Mult variable in the caption of a label when the user clicks the GetLast button: Figure : Last Property—Example procedure TForm1.GetLastClick(Sender: TObject); var Mult: TMult; Subscript: string; begin {Create Mult. Make Form1 its owner} Mult := TMult.Create(Form1); Mult[‘Fruit’] := ‘Apple’; element pairs one by one} Mult[‘Vegetable’] := ‘Potato’; Label1.Caption := ‘The subscript of the last element: ’ + Mult.Last + ‘, and its value: ’ + Mult[Mult.Last]; end; ListenerPort Property Applies to TRPCBroker Component Declaration property ListenerPort: Integer; Description The ListenerPort design-time property the developer the ability to select the Listener port on the VistA M Server. It must always be set before connecting to the server. If one M Server system has two or more environments (UCIs) that support client/server applications (e.g., Test and Production accounts), the Broker Listener processes must be listening on unique ports. Thus, you must specify which Listener port to use when you start the Listener on the VistA M Server. Consequently, if you have more than one Listener running on the same server, the application needs to specify the correct Listener for its connection request. This is accomplished using the ListenerPort property. After the initial connection, the VistA M Server connection is moved to another port number [i.e., Socket Property (read-only)], which is used for the remainder of the session. Example The program code in Figure 30 demonstrates using the ListenerPort Property: Figure : ListenerPort Property—Example procedure TForm1.btnConnectClick(Sender: TObject); brkrRPCBroker1.ListenerPort := 9001; brkrRPCBroker1.Connected := True; end;