reading a text file using forcase

Discussions about CSEntry
Post Reply
AriSilva
Posts: 499
Joined: July 22nd, 2016, 3:55 pm

reading a text file using forcase

Post by AriSilva » June 21st, 2021, 12:59 pm

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
Best
Ari

Gregory Martin
Posts: 1536
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: reading a text file using forcase

Post by Gregory Martin » June 25th, 2021, 12:12 pm

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?

AriSilva
Posts: 499
Joined: July 22nd, 2016, 3:55 pm

Re: reading a text file using forcase

Post by AriSilva » June 27th, 2021, 8:38 am

Thanks, Greg, will try
Best
Ari

Post Reply