Issues with FILESEEK

Previous topic - Next topic

zxevious

Hi,

I'm trying to test some code from help related to files

Code (glbasic) Select

LOCAL i%
// 1234
OPENFILE(1, "test.txt", TRUE)
DEBUG "pos(0)="+FILEPOSITION(1)+"\n"
READLONG 1,i%; DEBUG "read="+i+"\n"

// 1234
FILESEEK(1, 0, 0)
DEBUG "pos(0)="+FILEPOSITION(1)+"\n"
READLONG 1,i%; DEBUG "read="+i+"\n"

// 1234
FILESEEK(1, -4, 1)
DEBUG "pos(0)="+FILEPOSITION(1)+"\n"
READLONG 1,i%; DEBUG "read="+i+"\n"

// 1234
FILESEEK(1, -12, -1)
DEBUG "pos(0)="+FILEPOSITION(1)+"\n"
READLONG 1,i%; DEBUG "read="+i+"\n"

// 9911
FILESEEK(1, 4, 1)
DEBUG "pos(0)="+FILEPOSITION(1)+"\n"
READLONG 1,i%; DEBUG "read="+i+"\n"

CLOSEFILE 1


This is the error

_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.10.074 SN:eeb3c86b - 3D, NET
"DAT3.gbas"(18) error : syntax error

The Line 18 has FILESEEK(1, 0, 0). If I add comments (//) to fileseek command, It compiles without any issue.

This append with GLBasic IDE, Version: 10.118 and above.

What am I doing wrong?

Thanks in advance.
Best Regards.

Mass Effect 2 Fan!

Moru

Remove the () and it should work

zxevious

It works! Thank you very much indeed.
Best Regards.

Mass Effect 2 Fan!