TApxProtocol

HierarchyPropertiesMethods

Unit:

AxProtcl

Description:

TApxProtocol implements all of the Async Professional CLX file transfer capabilities in one comprehensive component. General issues associated with using this component are discussed in the first part of this chapter.

Note that certain properties that are described in the following reference section are specific to a particular protocol type. If a particular property is not supported by the current value of the ProtocolType property (e.g., the AsciiCharDelay property is not relevant to the Zmodem protocol), assigning a value to that property stores the new value in a field of the component, but has no effect until the ProtocolType is changed to the corresponding protocol. Protocol-specific properties have names that begin with the name of the protocol itself (e.g., ZmodemOptionOverride, ZmodemSkipNoFile, ZmodemFileOption, ZmodemRecover, and Zmodem8K).

Example

This example shows how to construct and use a protocol component. It includes a terminal window so you can navigate around an on-line service while you test the program, and a TApxProtocolStatus component so you can see the progress of the transfer.

Create a new project, add the following components, and set the property values as indicated in the following table:

Component
Property
Value
TApxComPort
ComNumber
<set as needed for your PC>
TApxEmulator

 

 
TApxTerminal

 

 
TApxProtocol
FileMask
EXPROT*.*
TApxProtocolStatus

 

 
TButton
Name
Upload
TButton
Name
Download

Double-click on the Upload button's OnClick event handler within the Object Inspector and modify the generated method to match this:

procedure TForm1.UploadClick(Sender : TObject);
begin
ApxProtocol1.StartTransmit;
end;

This method starts a Zmodem background protocol transmit session for all of the files matching the mask "EXPROT*.*". (Zmodem is the default protocol type for TApxProtocol instances.)

Double-click on the Download button's OnClick event handler within the Object Inspector and modify the generated method to match this:

procedure TForm1.DownloadClick(Sender : TObject);
begin
ApxProtocol1.StartReceive;
end;

This method starts a Zmodem background session to receive whatever files the transmitter sends.

The form includes a TApxProtocolStatus component, which is automatically displayed by the protocol and periodically updated to show the progress of the file transfer.

This example is in the EXPROT project in the Async Professional CLX/examples directory.