| Anonymous | Login | Signup for a new account | 2013-05-22 01:45 BST | ![]() |
| Main | My View | View Issues | Roadmap | My Account |
| View Issue Details [ Jump to Notes ] | [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0003110 | GameMaker: Studio | [All Projects] Functions | public | 2012-05-02 13:13 | 2013-03-05 15:33 | |||
| Reporter | kroart | |||||||
| Assigned To | Russell Kay | |||||||
| Priority | High | Severity | C - General | Reproducibility | 100% | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Summary | 0003110: More issues when working with text files. | |||||||
| Description | Arrr!! Again one more error when trying to work with text files. Next code gives an error "File is not opened for reading." f = file_text_open_write("test"); file_text_write_real(f, 0.00001); file_text_write_real(f, -1001); file_text_write_real(f, 4.4895); file_text_write_real(f, 1057.4894); file_text_write_real(f, -1581.1542); file_text_close(f); f = file_text_open_read(f); while (!file_text_eof(f)) show_message(string(file_text_read_real(f))); file_text_close(f); If I'm trying to comment next two strings while (!file_text_eof(f)) show_message(string(file_text_read_real(f))); then I got error "Trying to close unexisting text file." It doesn't work on windows and on android. Not tested on other platforms | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0001565) kroart (updater) 2012-05-02 14:40 |
Also created file has string "1e-005 -1001 4.4895 1057.49 -1581.15 " without space as first symbol. And therefore it reads number incorrectly. This is fifth issue with text file read-write. Please make it work already. |
|
(0001570) Erik Leppen (updater) 2012-05-02 15:55 |
Use file_text_writeln(f) after eacht write_real, and file_text_readln(f) after each read_real. Then, the text file will contain every number on a separate line. Also, f = file_text_open_read(f) should be f = file_text_open_read("test"); f is not a valid filename, so therefore you get the "file is not opened for reading" error. However I think it should give the error "not a valid filename". By the way, I'd like to suggest to YoYo to increase the precision of written reals because as I see it here, they're cut off after two decimals. |
|
(0001579) kroart (updater) 2012-05-02 19:51 edited on: 2012-05-02 19:53 |
f = file_text_open_read(f); - oops. My mistake. Sorry. No error shows now. And I'm agree with Erik Leppen. Precision may be more accurate. Need to post new issue for this wish I suppose? |
|
(0001586) Russell Kay (administrator) 2012-05-02 23:11 |
This was fixed a while back and I pointed out the error in the code back then.. Also reals are now written out at full precision Note: The first number is 1e-005 they are no longer stored at 2 decimal places... |
| Copyright © 2000 - 2012 MantisBT Group |