Contents - Index


$ExportText

 

The $ExportText directive provides a simple way of writing string information contained in string variables to an ASCII file.  The $ExportText is similar to the $Export directive with the differences being that it is designed to output string variable information, each string is written on a separate line without quotes and no header information is written if the filename extension is .TXT. 

 

The format of the $ExportText directive is 

 

$ExportText /A  'FileName'   S1$, S2$, S$[1..4]

 

FileName can be either a string constant (within single quotes) or a string variable containing the name of the file that the values will be written to.  If filename is specified to be 'CLIPBOARD', the string output will appear on separate lines as text on the clipboard.  A maximum of 65,000 characters can be written to the clipboard.

 

/A is optional.  If present, this option will append the string information to the end of the file, if it exists.

 

S1$, S2$, S$[1..4] represent string variables that are defined in your EES program.  Note that array range notation is supported.

 

The $ExportText directive can be placed anywhere in the Equations Window, including within Functions, Procedures, and Subprograms.  Multiple $ExportText directives are permitted, and they will be evaluated in the order that they occur in the Equations Window. 

 

 

Example 1:

 

N=4

Duplicate i=1,N

    S$[i]=concat$('Line ',string$(i))

End

$EXPORTTEXT 'C:\temp\Lines.txt'  S$[1..N]

 

After solving, file C:\temp\Lines.txt will contain:

 

Line 1

Line 2

Line 3

Line 4

 

See also: $Export, $ImportText