Skip to main content
insightsoftware Documentation insightsoftware Documentation
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

ExportVariable

Use this command to export the values of variables to an external text file.

Caution: The names of variables in Longview Application Framework to be used in data event triggers are limited to 10 characters. The convention is E_DIMNAME (where DIMNAME is the first 8 characters of the dimension name). In the case where the first 8 characters of the dimension names are the same, the variables are named E_DIMNAME_N (where DIMNAME is the first 6 characters of the dimension, and N is the dimension number).

Syntax

EXPORTVARIABLE VariableName FileName [APPEND]

where:

  • VariableName is the name of a particular variable.

  • FileName is an ASCII file containing the data. It can include a complete or partial folder path in the format C:\...\FileName. If FileName includes spaces, enclose it in double quotation marks;

    for example: @"C:\My Documents\My Data.txt"

    Note: If the document is in the same location as lv_af.exe, you do not need to specify the drive or path. If the path specified does not exist, it will be created. The folder path can have a maximum length of 260 characters.

  • APPEND directs the command to place the variable’s value in a new line of an existing text file.

If the named text file does not exist, it is automatically created, even if APPEND is part of the command.

Caution: If the named text file already exists and APPEND is not designated, the existing text file will be overwritten and any data stored in it will be lost.

Syntax example

CREATE VARIABLE X AS STRING

CREATE VARIABLE Y AS NUM

SET VARIABLE X = "YEAR"

SET VARIABLE Y = 2007

EXPORTVARIABLE X Variables.txt

EXPORTVARIABLE Y Variables.txt APPEND

See also

Published:

ExportVariable

Use this command to export the values of variables to an external text file.

Caution: The names of variables in Longview Application Framework to be used in data event triggers are limited to 10 characters. The convention is E_DIMNAME (where DIMNAME is the first 8 characters of the dimension name). In the case where the first 8 characters of the dimension names are the same, the variables are named E_DIMNAME_N (where DIMNAME is the first 6 characters of the dimension, and N is the dimension number).

Syntax

EXPORTVARIABLE VariableName FileName [APPEND]

where:

  • VariableName is the name of a particular variable.

  • FileName is an ASCII file containing the data. It can include a complete or partial folder path in the format C:\...\FileName. If FileName includes spaces, enclose it in double quotation marks;

    for example: @"C:\My Documents\My Data.txt"

    Note: If the document is in the same location as lv_af.exe, you do not need to specify the drive or path. If the path specified does not exist, it will be created. The folder path can have a maximum length of 260 characters.

  • APPEND directs the command to place the variable’s value in a new line of an existing text file.

If the named text file does not exist, it is automatically created, even if APPEND is part of the command.

Caution: If the named text file already exists and APPEND is not designated, the existing text file will be overwritten and any data stored in it will be lost.

Syntax example

CREATE VARIABLE X AS STRING

CREATE VARIABLE Y AS NUM

SET VARIABLE X = "YEAR"

SET VARIABLE Y = 2007

EXPORTVARIABLE X Variables.txt

EXPORTVARIABLE Y Variables.txt APPEND

See also

For an optimal Community experience, Please view on Desktop