FSEEK

Concept Link IconSee also Concept Link IconExample

Move a file pointer to a new position.

WebVue support - Yes.

Before using any of the file management instructions, except FSTAT, RENAME, UNLINK, FILETOBUF or BUFTOFILE, you must first open the file using an FOPEN instruction.

Before any program including the FOPEN instruction ends, it must execute an FCLOSE instruction.

Syntax

IntVal = FSEEK(Filename, Offset, Origin);

Return type: INTEGER.

Argument

Meaning

Filename

The name of the file on which the operation is to be performed. Type STR.
If executed in a WebVue session context this instruction is processed by the computer that hosts the web back end and the referenced file is on that computer.

Offset

The offset in bytes by which the pointer is to be moved. Any numeric type.

Origin

The point from which the offset is taken. 0 specifies the start of the file, 1 the current position of the pointer and 2 the end of the file.

Execution

The file pointer is moved to a new position. The next operation on the file will be made from there.

Return: 1 if successful, else 0.

Example

'move the pointer to the 20th byte from the start

i1 = FSEEK("histo.fil",20,0);

For further examples, select the Example link above.