Author Topic: Issues with FILESEEK  (Read 1796 times)

Offline zxevious

  • Mc. Print
  • *
  • Posts: 21
  • Making games I can forget my daily work!
    • View Profile
Issues with FILESEEK
« 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.
Best Regards.

Mass Effect 2 Fan!

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1793
    • View Profile
    • Homepage
Re: Issues with FILESEEK
« Reply #1 on: 2012-Feb-16 »
Remove the () and it should work

Offline zxevious

  • Mc. Print
  • *
  • Posts: 21
  • Making games I can forget my daily work!
    • View Profile
Re: Issues with FILESEEK
« Reply #2 on: 2012-Feb-16 »
It works! Thank you very much indeed.
Best Regards.

Mass Effect 2 Fan!