GetReadPos

File management function.

The GetReadPos function returns the value of the read pointer for the specified file.

Syntax

GetReadPos(<filename>)
or
var=GetReadPos(<filename>)

Parameters

<filename>, string, name of the file which is being read.

Return value

var, numeric, value for the read pointer, which gives the position for the next read. GetReadPos allows you to know this value (in bytes from the beginning of the file). The value of this pointer is 0 when the file is read for the first time, then WinTask increments it automatically. If <filename> is not currently being read, GetReadPos returns 0. If <filename> is empty or the file does not exist, an error message is displayed and all the scripts are stopped.

It is sometimes interesting to know the value of this pointer in order to force the next Read at a specific position.

Examples

 

var = GetReadPos("\\Server\C\my directory\my file.txt")

For a full example, see the Read statement.