You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 18
Next »
PUT$ writes data to a file
Syntax
PUT$(FileName$, Contents$, [InpVar])
Arguments
- FileName$ is a string expression containing the name of a file to which taahe contents of string Contents$ has to be written. If FileName$ does not contain a path, the file is assumed to be present on the current Quaestor Report directory.
- Contents$ is a string or document that has to be written to file FileName$. For Contents$, the TEMPLATE$ function can be used to create an arbitrarily formatted set of data, i.e. non-Telitab input files.
- InpVar is an optional list of parameters or functions. The list has to contain the parameters, used by the function TEMPLATE$() if that is used as Contents$.
- The PUT$ function can be used to export data from a string into an input file for a satellite program. This can be used, in combination with TEMPLATE$() and the GET$() function, to run a satellite program.
Examples
Example 1: Exporting data
Using the function:
A$ = PUT$("INPUT.EPI",INPUT$)
If the string INPUT$ contains the TeLiTab:
0
2 "XC" "YC"
"1" 1 1
"2" 2 4
"3" 3 9
"4" 4 16
"5" 5 25
"6" 6 36
"7" 7 49
"8" 8 64
"9" 9 81
"10" 10 100
The string A$ will return the name of the input file: INPUT.EPI
And the file INPUT.EPI will contain the TeLiTab:
0
2 "XC" "YC"
"1" 1 1
"2" 2 4
"3" 3 9
"4" 4 16
"5" 5 25
"6" 6 36
"7" 7 49
"8" 8 64
"9" 9 81
"10" 10 100
Example 2: Running a satellite program
PUT$(), in combination with GET$(), is an alternative for FUNCTION as GET$() returns ALL output in file FileName$ in the form of a single string on the basis of input files.
An example can be found in the description of the function GET$().
Example 3: Saving an embedded file
The syntax
PUT$("File.ext", "NullString")
saves an object embedded in the relation containing this function to a file in the current knowledge base project directory (if no path information is included in the file name).
Quick links: Function overview | Attribute overview | Constants overview | Dimensions overview