Page 1 of 1

reading a text file using forcase

Posted: June 21st, 2021, 12:59 pm
by AriSilva
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

Re: reading a text file using forcase

Posted: June 25th, 2021, 12:12 pm
by Gregory Martin
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?

Re: reading a text file using forcase

Posted: June 27th, 2021, 8:38 am
by AriSilva
Thanks, Greg, will try