SaveCSVFile Method


9.0B, PLBCMP GUI Only

 

The SaveCSVFile method stores the contents of a LISTVIEW object into a CSV file. The method uses the following format:

 

 

[label]

{object}.SaveCSVFile

[GIVING {return}] USING [*FileName=]{fname}[:

 

 

 

[*Options=]{options}][:

 

 

 

[*Delimiter=]{delim}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A LISTVIEW object that is accessed.

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 specifies the load options.

delim

Optional. A Character String Variable or literal that specifies the delimiter character.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. If the value returned is zero, the ZERO Condition Flag is set.

  2. The OVER and EOS Condition Flags are always cleared.

  3. When running under the PL/B Application Server, the first character of the file name has special meaning:

  4.  

    Value

    The file ...

    ! (exclamation mark)

    resides on the client rather than the server.

     

  5. The {options} value is a constant as defined in PLBMETH.INC or a numeric variable indicating one or more of the following option values:

  6.  

    Keyword

    Value

    Meaning ...

    $LV_CSVWR_QUOTED

    0x1

    Write column data in quoted format.

    $LV_CSVWR_OUTPUTSEL

    0x2

    Output only selected rows.

    $LV_CSVWR_OUTPUTCHK

    0x4

    Output only checked rows.

    $LV_CSVWR_OUTPUTHEADER

    0x8

    Output the column names as the first record.

    $LV_CSVWR_NOZEROWIDTH

    0x10

    Prevents the data for an column with a zero width from being output.

    $LV_CSVWR_LOWERCASE

    0x20

    Output the data as lowercase.

    $LV_CSVWR_UPPERCASE

    0x40

    Output the data as uppercase.

    $LV_CSVWR_ORDERARRAY

    0x80

    Output the data using the current left-to-right column order. If this bit mask value is not specified, the default output is ordered using the columns as created. (9.4D)

    $LV_CSVWR_NOANSI2OEM

    0x100

    NO ANSI to OEM translation (9.9A)

     

  7. If not specified, {delim} defaults to a comma.

  8. A return value of zero (0) indicates success.

  9. This method is not available when using the PL/B Web Server with the LINUX/Linux operating system.

 

 

See Also: Method Syntax, LISTVIEW Methods

 



PL/B Language Reference LoadXMLFile Method (LISTVIEW) SaveXMLFile Method (LISTVIEW)