GLBasic forum

Main forum => Bug Reports => Topic started by: Moru on 2009-Jun-28

Title: OPENFILE max channel?
Post by: Moru on 2009-Jun-28
Any of these lines (separately in a project) causes the below error. Can the channel number be max 7? Not that I need that many open at the same time, I just wanted to pick a "safe" number so I can easily include the code in new or old projects without having to change the channel number. I don't see anything in the manual about it though.

Code (glbasic) Select
OPENFILE(8, "test.txt", -1)
OPENFILE(8, "test.txt", 0)
OPENFILE(8, "test.txt", 1)


Code (glbasic) Select

_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.2009.113 - 3D, NET
Wordcount:2 commands

compiling:

linking:
success
_______________________________________
*** Finished ***
Elapsed: 1.3 sec. Time: 09:41
Build: 1 succeeded.

Start debug session.
_______________________________________
Injection started

Error:
Unknown Error:
7
Title: Re: OPENFILE max channel?
Post by: MrTAToad on 2009-Jun-28
Same here - looks like the channel number is limited to be either 0 or 1, otherwise I get :

Error:
No file
Title: Re: OPENFILE max channel?
Post by: Moru on 2009-Jun-28
channel number up to 7 works fine for me.
Title: Re: OPENFILE max channel?
Post by: MrTAToad on 2009-Jun-28
Odd!
Title: Re: OPENFILE max channel?
Post by: Kitty Hello on 2009-Jun-28
Aye 0-7 is valid.
Use GENFILE() instead to be sure you're not overwriting an already open channel.
Title: Re: OPENFILE max channel?
Post by: Moru on 2009-Jun-28
Oh, that exists! I have been looking for it but can't find it in the helpfile. Is that something new for the next version mabe?
Title: Re: OPENFILE max channel?
Post by: Kitty Hello on 2009-Jun-28
ah, might be. Yes, version 7 will have GENSPRITE() and GENSOUND and whatever.