2606B System SourceMeter® Instrument Reference Manual
Section 7: TSP command reference
2606B-901-01 Rev. B / May 2018
7-91
"*a"
: Returns the whole file, starting at the current position (returns an empty string if the current file
position is at the end of the file).
"*l"
: Returns the next line, skipping the end of line; returns
nil
if the current file position is at the
end of file.
n
: Returns a string with up to n characters; returns an empty string if n is zero; returns
nil
if the
current file position is at the end of file.
If no format parameters are provided, the function will perform as if the function is passed the value
"*l"
.
Any number of format parameters may be passed to this command, each corresponding to a returned
data value.
Also see
(on page 7-92)
(on page 7-108)
(on page 7-109)
fileVar:seek()
This function sets and gets the present position of a file.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
position, errorMsg
=
fileVar
:seek()
position, errorMsg
=
fileVar
:seek(
whence
)
position, errorMsg
=
fileVar
:seek(
whence
,
offset
)
position
The new file position, measured in bytes from the beginning of the file
errorMsg
A string containing the error message
fileVar
The file descriptor variable
whence
A string indicating the base against which
offset
is applied; the default is
"cur"
offset
The intended new position, measured in bytes from a base indicated by
whence
(default is
0
)
Details
The
whence
parameters may be any of the following:
"set"
: Beginning of file
"cur"
: Current position
"end"
: End of file
If an error is encountered, it is logged to the error queue, and the command returns
nil
and the error
string.
Also see
(on page 7-109)