*CDFON (DISK I/O)


 

*CDFON

 

This disk I/O control allows easy reading or writing of comma-delimited fields. This control affects all variables remaining in the list. The *CDFON control is automatically canceled at the end of a statement.

 

When *CDFON is specified in a WRITE statement, each DIM, FORM, and literal is enclosed with a double quote and each field following the first field is separated with a comma.

 

When *CDFON is specified in a READ statement, each DIM variable is filled with the data for each comma-delimited field. DIM variables are the only variables allowed while a *CDFON control is active. If other variables are used, the results are unpredictable. The EOS flag is set if data is lost for any given DIM variable after the *CDFON control is encountered.

 

The *CDFON and *EDION are mutually exclusive. Both cannot be active at the same time.

 

The PLB runtimes and Sundm servers allow the *CDFON IO control delimiter character (i.e., comma) to be defined and set by the end user application as follows (9.8A):

 

  1. Use new runtime\sundm keyword named 'PLB_CDFDELMDEFAULT={delmchr}'.

  2.  

  3. Use 'SETMODE *CDFDELMDEFAULT={svar}' instruction to set the *CDFON delimiter character under program control. When the 'SETMODE *CDFDELMDEFAULT' instruction is executed in a program, the 'SETMODE CDFDELMDEFAULT' replaces the setting specified by the 'PLB_CDFDELMDEFAULT' runtime keyword.

  4.  

  5. When executing under the Windows, enable the *CDFON locale delimiter mode which causes the Windows Locale List Separator OS setting to be used for the *CDFON delimiter character. The Windows locale mode can be enabled using the 'SETMODE *CDFDELMUSELOCALE=1' instruction. Enabling the locale mode takes precedence over all other settings used for the *CDFON delimiter character.

  6.  

  7. Use a new OPEN\PREP {mode} parameter bit setting named 'CMP_LOCALECDF' which invokes the Windows locale mode for the file variable. Using the 'CMP_LOCALECDF' mode setting takes precedence over all other *CDFON delimiter character settings and cannot be changed as long as the file variable is opened. The 'CMP_LOCALECDF' ONLY applies to AFILE, FILE, and IFILE variables.

 

 

See Also: List Controls (Disk I/O), Disk I/O Instructions

 



PL/B Language Reference *CDFOFF (Disk I/O) *EDIOFF (Disk I/O)