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

Write

Use this command in conjunction with the Create Document command to write to a document in the document cache. For example, you may need to create a DataSpec document in which the number of temporary symbols is unknown until run time.

You can write to a document from a variable or from a physical file. When you write to a document from a variable, you are restricted by the maximum variable size of 4000 characters. To circumvent this restriction, you can write to a document from a physical file.

Syntax:

Write DocName VARIABLE|FILE VariableName|FileName [APPEND]

where:

  • DocName is the name of the document object to write to, and must match the DocName as specified in the related Create Document command, including the path and extension.
  • VARIABLE writes the contents of a variable to the document. If you use this option, you must specify the VariableName.
  • FILE writes the contents of a physical file to the document. If you use this option, you must specify the FileName.
  • VariableName is the name of the variable. You can specify a STRING, NUM, or RANGE variable. STRING list and NUM list variables are also supported.
  • FileName is the name of the physical file. Optionally, you can include a file path. If the path includes spaces, you must enclose it in double quotation marks. For Longview Apps, the default path is the path specified in the <rootpath> tag of the .lvapp file. If no root path is specified, the system assumes the root path is the applications folder in the working directory. For Longview Application Framework, the default path is the lvaf folder in the working directory.
  • APPEND is optional and specifies to append the variable or file contents to the document. If you do not specify this option, the document is cleared before writing.

Syntax example from a variable, with variable resolved:

CREATE DOCUMENT MyDataView.lvdvw

CREATE VARIABLE sOutPut as STRING

Set VARIABLE sOutPut = "InsertSeparator BLANK, ACCOUNTS, Validation$nLoop$, Before, 1, $nRowSeparatorHeight$"

WRITE MyDataView.lvdvw VARIABLE sOutput

Syntax example from a variable, with variable unresolved:

Create DOCUMENT MyDataView.lvdvw

CREATE VARIABLE sOutPut as STRING

Set VARIABLE sOutput = "InsertSeparator BLANK, ACCOUNTS, Validation” + “$” + “nLoop” + “$” + “, Before, 1,” + “$” + “nRowSeparatorHeight” + “$”

WRITE MyDataView.lvdvw VARIABLE sOutput

Syntax example from a file and appended:

CREATE DOCUMENT MyDataView.lvdvw Write MyDataView.lvdvw FILE "C:\Testing\ApplicationFramework\DataView1.lvdvw" APPEND

See also

Published:

Write

Use this command in conjunction with the Create Document command to write to a document in the document cache. For example, you may need to create a DataSpec document in which the number of temporary symbols is unknown until run time.

You can write to a document from a variable or from a physical file. When you write to a document from a variable, you are restricted by the maximum variable size of 4000 characters. To circumvent this restriction, you can write to a document from a physical file.

Syntax:

Write DocName VARIABLE|FILE VariableName|FileName [APPEND]

where:

  • DocName is the name of the document object to write to, and must match the DocName as specified in the related Create Document command, including the path and extension.
  • VARIABLE writes the contents of a variable to the document. If you use this option, you must specify the VariableName.
  • FILE writes the contents of a physical file to the document. If you use this option, you must specify the FileName.
  • VariableName is the name of the variable. You can specify a STRING, NUM, or RANGE variable. STRING list and NUM list variables are also supported.
  • FileName is the name of the physical file. Optionally, you can include a file path. If the path includes spaces, you must enclose it in double quotation marks. For Longview Apps, the default path is the path specified in the <rootpath> tag of the .lvapp file. If no root path is specified, the system assumes the root path is the applications folder in the working directory. For Longview Application Framework, the default path is the lvaf folder in the working directory.
  • APPEND is optional and specifies to append the variable or file contents to the document. If you do not specify this option, the document is cleared before writing.

Syntax example from a variable, with variable resolved:

CREATE DOCUMENT MyDataView.lvdvw

CREATE VARIABLE sOutPut as STRING

Set VARIABLE sOutPut = "InsertSeparator BLANK, ACCOUNTS, Validation$nLoop$, Before, 1, $nRowSeparatorHeight$"

WRITE MyDataView.lvdvw VARIABLE sOutput

Syntax example from a variable, with variable unresolved:

Create DOCUMENT MyDataView.lvdvw

CREATE VARIABLE sOutPut as STRING

Set VARIABLE sOutput = "InsertSeparator BLANK, ACCOUNTS, Validation” + “$” + “nLoop” + “$” + “, Before, 1,” + “$” + “nRowSeparatorHeight” + “$”

WRITE MyDataView.lvdvw VARIABLE sOutput

Syntax example from a file and appended:

CREATE DOCUMENT MyDataView.lvdvw Write MyDataView.lvdvw FILE "C:\Testing\ApplicationFramework\DataView1.lvdvw" APPEND

See also

For an optimal Community experience, Please view on Desktop