file_text_open_read("filename.txt") is Failing
4 posters
Page 1 of 1
file_text_open_read("filename.txt") is Failing
This command is failing. I mean, it won't actually open the file. Here is what I have:
f=file_text_open_read("file.txt")
show_message(string(f))
The show_message command is returning the file number -1 for some reason. Only positive numbers
f=file_text_open_read("file.txt")
show_message(string(f))
The show_message command is returning the file number -1 for some reason. Only positive numbers
Re: file_text_open_read("filename.txt") is Failing
file_text_open_read() doesn't actually read the file. It only opens the file and returns an identifier that can be used in file_text_read_string/real. If you want to read from the file and show it on the screen, you could do something like this:
There is such a thing as file_text_read_real and file_text_write_real, but I advise using only strings because you can easily convert them to real numbers using real().
- Code:
f=file_text_open_read("file.txt");
data=file_text_read_string(f); //Give this function your identifier variable
show_message(data);
file_text_close(f); //Always remember to close your files!
There is such a thing as file_text_read_real and file_text_write_real, but I advise using only strings because you can easily convert them to real numbers using real().
Re: file_text_open_read("filename.txt") is Failing
I know all that, but it won't actually open the file for reading. It returns a negative integer, which is not correct. The program is not using the command correctly
Re: file_text_open_read("filename.txt") is Failing
file_text_open_read() returns -1 when the file with the specified filename does not exist.
Re: file_text_open_read("filename.txt") is Failing
hehe, yeah. It tried to open a file that didn't exist
Re: file_text_open_read("filename.txt") is Failing
you could also use file_text_open_write() as it will create it if it doesnt exist
awasteoflife- Junior Member
-
Number of posts : 174
Age : 30
Location : My house
Job/hobbies : Prohramming, Gaming and Paperrounds
Warning :
Reputation :
Registration date : 2008-07-25
Re: file_text_open_read("filename.txt") is Failing
and how u place information it is done how?
mrsmes- Newbie
- Number of posts : 13
Warning :
Reputation :
Registration date : 2008-08-20
Re: file_text_open_read("filename.txt") is Failing
Please make your own thread for new questions.mrsmes wrote:and how u place information it is done how?
But to answer, you must use file_text_write_string() or file_text_write_real(). Check the GM Manual for more info.
Similar topics
» HELP on Fallout 3! Where can I find "Sentinel Lyons" in GNR Building Plaza?
» Norton Antivirus "cookie"?
» Norton Antivirus "cookie"?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum