Is there a way to execute a forcase more than once for the same file?
I´ve tried to close the file and open it again, but apparently it is not working, the second time it does not execute the loop.
What should I have to do?
Best
forcase loop
-
AriSilva
- Posts: 625
- Joined: July 22nd, 2016, 3:55 pm
Re: forcase loop
I´ve found that the set first does the job, provided you do not close the file before hand.
By the way, what´s the reason to close an external file that you opened for reading?
By the way, what´s the reason to close an external file that you opened for reading?
Best
Ari
Ari
-
josh
- Posts: 2403
- Joined: May 5th, 2014, 12:49 pm
- Location: Washington DC
Re: forcase loop
You should not have to do anything. Forcase should automatically restart at the first case in the file. If you do something like:
trace(on);
trace("Loop 1");
forcase MY_DICT do
trace("%s", key(MY_DICT));
enddo;
trace("Loop 2");
forcase MY_DICT do
trace("%s", key(MY_DICT));
enddo;
then you should get the all the cases in the file listed twice.trace("Loop 1");
forcase MY_DICT do
trace("%s", key(MY_DICT));
enddo;
trace("Loop 2");
forcase MY_DICT do
trace("%s", key(MY_DICT));
enddo;
-
Gregory Martin
- Posts: 1946
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: forcase loop
There is rarely a reason to close an external file. Prior to CSPro 7.0, it could have been useful to close a text data file if you had two applications running because both couldn't access the file at the same time, but with .csdb, multiple applications can access the file at the same time (as external files) so there is little use for close.
-
AriSilva
- Posts: 625
- Joined: July 22nd, 2016, 3:55 pm
Re: forcase loop
Thank you, my fault.
Somewhere in the program I was closing the external file, and then it would not execute the forcase.
Is there a way to warn the user about that?
Somewhere in the program I was closing the external file, and then it would not execute the forcase.
Is there a way to warn the user about that?
Best
Ari
Ari