OPENFILE max channel?

Previous topic - Next topic

Moru

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

MrTAToad

Same here - looks like the channel number is limited to be either 0 or 1, otherwise I get :

Error:
No file

Moru

channel number up to 7 works fine for me.

MrTAToad


Kitty Hello

Aye 0-7 is valid.
Use GENFILE() instead to be sure you're not overwriting an already open channel.

Moru

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?

Kitty Hello

ah, might be. Yes, version 7 will have GENSPRITE() and GENSOUND and whatever.