property Capture : TApxCaptureMode
TApxCaptureMode = (cmOff, cmOn, cmAppend);
Default: cmOff
Defines whether the data received by the terminal is captured to file.
The Capture property has only two values on reading: whether the terminal is capturing data (cmOn will be returned) or not (cmOff will be returned).
It has three possible values on writing: cmOn, cmOff, or cmAppend. If the value written is cmAppend and the current value is cmOff, the capture file is opened in non-sharing mode for appending data and the value of the Capture property is then set to cmOn. Note that if the file doesn't exist at the time the property is set, it will be created. If the value written is cmAppend and the current value is cmOn, the assignment is ignored and nothing happens.
If the value written is cmOn and the current value is cmOff, the file is created. If it existed prior to the assignment, it will be overwritten.
The name of the file where captured data is written is given by the CaptureFile property.
All data coming into the terminal is written to the file without any effort being made to parse it or identify terminal control sequences. Thus, for a complex terminal emulation the data in the capture file will consist of intermingled text and terminal control sequences.
If the CaptureFile property has not been set to the name of a file (i.e., it is the empty string), setting Capture to cmOn or cmAppend will have no effect. The attempt will be ignored and no exception will be raised. If the CaptureFile property has been set, an attempt is made to create or open the file so named. This operation can of course fail for any of a number of different reasons. Internally, the terminal uses a file stream (TFileStream) to access the file, so any I/O exceptions raised will be those used by the standard CLX class.
See also: CaptureFile