SaveCSVFile Method (DATATABLE)
10.5, PLBCMP GUI Only
The SaveCSVFile method stores the contents of a DATATBLE into a delimited file. The method uses the following format:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A DATATABLE object.
return
Optional. A Numeric Variable that indicates the success or failure of the method.
fname
Required. A Character String Variable or literal that specifies the file name.
options
Optional. A decimal number or Numeric Variable that has a bit mask value described below.
delim
Optional. A Character String Variable or literal that specifies the delimiter character.
Flags Affected: EOS, OVER, ZERO
Note the following:
The EOS flag is always cleared.
The ZERO flag is set if the {return} value is zero.
The OVER flag is set if the {return} variable is too small to receive the return value.
The {options} bit mask values indicate one of the following:
|
Value |
Constant |
Meaning |
|
0x1 |
$TBL_CSVRD_QUOTED |
Output as quoted. |
|
0x2 |
$TBL_CSVWR_OUTPUTSEL |
Output only the selected data. |
|
0x4 |
$TBL_CSVWR_OUTPUTCHK |
Output only the checked data. |
|
0x8 |
$TBL_CSVWR_OUTPUTHEADER |
Output the header column text. |
|
0x10 |
$TBL_CSVWR_NOZEROWIDTH |
Output skips zero width columns. |
|
0x20 |
$TBL_CSVWR_LOWERCASE |
Output data as lowercase. |
|
0x40 |
$TBL_CSVWR_UPPERCASE |
Output data as uppercase. |
|
0x80 |
$TBL_CSVWR_BYORDERARRAY |
Output data using DATATABLE order array |
If not specified, {delim} defaults to a comma.
A return value of zero (0) indicates success. Failures return one of the following values:
|
Value |
Meaning |
|
200 |
There is a file name problem. |
|
201 |
There are no columns defined in the DATATABLE. |
|
202 |
Unable to create the specified file. |
|
203 |
Unable to write to the specified file. |
See Also: Method Syntax, DATATABLE Methods
![]() |