The CpsData procedure compresses the input value and returns it as a compressed value. The compressed value is usually shorter than the original uncompressed value.
varying-char-value CpsData( szUnCompressedData 65535A Const Varying nRtnLen 10I 0 Options(*NOPASS) |
See also: DPSData |
If the function succeeds, the return value is the a compressed version of the szUnCompressedData parameter. The length of the returned data can be detected by passing a 2nd parameter to this procedure. Also if the returned data is assigned to a variable length field, the field's length is set to the length of the return data.
The following example compresses the text string "Lunar Spacecraft Company" and stores the compressed value in the field named COMPRESS.
.....DName+++++++++++EUDS.......Length+TDc.Functions+++++++++++++++++++++++++
D Company S 50A Inz('Lunar Spacecraft Company')
D Compress S 50A Varying
.....CSRn01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++
C Eval compress = CpsData(Company)