My application calls an apk which writes a .dat file.
After that, if successful, it reads this .dat file with a forcase block, and it is unable to read anything.
If I read the same file with a fileread it works fine.
If I close my application and open it again, without calling the external apk (the .dat file is already there), it works fine.
I´ve tried several combinations of setfile, close, open, copy the filed to another file, etc, but nothing works but having to close the app and opening it again.
What am I doing wrong?
Best
Ari
reading a text file using forcase
-
- Posts: 1796
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: reading a text file using forcase
This sounds quite strange because text data files are opened using the same mechanism as logic files (read using fileread). The only thing I can think of is that the text file's index is invalid, but I don't know why closing and opening the program would fix that problem.
Just to test things, I would make sure you:
1) Close your dictionary to make sure the data file and index aren't open.
2) Delete the index in logic: filedelete("name of data file" + ".csidx");
Does this by chance fix the problem?
Just to test things, I would make sure you:
1) Close your dictionary to make sure the data file and index aren't open.
2) Delete the index in logic: filedelete("name of data file" + ".csidx");
Does this by chance fix the problem?