NewCsvFileOutputRecordStream Method

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

Syntax

Engine.NewCsvFileOutputRecordStream ( absolutePath, openMode)

Return Value

CsvFileOutputRecordStream

Purpose

Create a new CsvFileOutputRecordStream for the specified file.

Remarks

When the returned CsvFileOutputRecordStream is no longer needed, it should be closed by calling OutputRecordStream.Close. If it is not closed already, the stream closes automatically when the last reference to it is removed.

Parameters

absolutePath As String

[In] Specifies the absolute path to the CSV file.

openMode As Long

[In] Specifies how to open the CSV file. Supported options include:

    FileOpenMode_NoOptions - Create the file if it does not exist. Fail with a run-time error if the file exists.

    FileOpenMode_Truncate - If the file exists, overwrite it deleting the previous contents. Create a new file if it does not exist.

    FileOpenMode_Append - If the file exists, append to the end of it, preserving the existing contents. Create a new file if it does not exist.

    FileOpenMode_Uniquify - Create a new file if it does not exist. If a file with the specified path exists, attempt to make the file name unique by appending "_" (underscore) plus a numeric suffix to the file name. For example, if AlreadyExists.csv already exists, AlreadyExists_2.csv is tried, then AlreadyExists_3.csv, etc. until a unique name has been found. If a unique name is not found after 10000 attempts, the method fails and throws a runtime error.


See Also

CsvFileOutputRecordStream

OutputRecordStream.Close

FileOpenModes

WAS THIS ARTICLE HELPFUL?

Not Helpful