GLBasic forum

Main forum => Bug Reports => Topic started by: zxevious on 2012-Feb-16

Title: Issues with FILESEEK
Post by: zxevious on 2012-Feb-16
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.
Title: Re: Issues with FILESEEK
Post by: Moru on 2012-Feb-16
Remove the () and it should work
Title: Re: Issues with FILESEEK
Post by: zxevious on 2012-Feb-16
It works! Thank you very much indeed.