File I/O problems! Help!
- Posted by keiser <keiser at KEISER.EZL.COM> Mar 14, 1997
- 978 views
Here is the program src: include get.e object a integer b, c b = 0 b = open("c:\\euphoria\\code\\test.dat", "r") c = open("c:\\euphoria\\code\\test.txt", "w") a = gets(b) puts(c, b) close(b, c) puts(1, "Done.\n") Now, when I run it, i get this error: read.ex:9 bad file number (-1) -->see ex.err Ok, ex.err: Global & Local Variables C:\EUPHORIA\INCLUDE\get.e: input_file = <no value> input_string = <no value> string_next = <no value> ungot_char = <no value> read.ex: a = <no value> b = -1 c = 3 What did I do wrong, and can someone show me the correct way to do read/write programs (simple ones like this.). Thanks.