Computer Science Canada

File I/O issues...

Author:  Insectoid [ Fri Jul 04, 2008 10:24 pm ]
Post subject:  File I/O issues...

So, I'm making a database program. To accomodate the varying number of entries, I have decided to input the number of entries from the database TXT file, to use as the upper bounds in arrays/for loops. I got an error saying this:

Turing Error wrote:

Get attempted on incompatible stream number 1


What does this mean?

Here is the offending code:

code:

var num_entries : int
open : database, "Database.txt", put
get : database, num_entries


Help?

Author:  gitoxa [ Fri Jul 04, 2008 10:28 pm ]
Post subject:  RE:File I/O issues...

You opened the stream with the ability to 'put' to it. You're trying to 'get' from it.

Author:  Insectoid [ Fri Jul 04, 2008 10:44 pm ]
Post subject:  RE:File I/O issues...

D'oh! lol, I even checked that...so stupid...


: