When reading an external file with the forcase, the inputorder is sequential or indexed?
If it is indexed, is there a way to force it to read it sequentially?
Or the other way around, that is, if it is sequential, can we force it to be read indexed?
forcase loop
-
- Posts: 1801
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: forcase loop
The current implementation only allows you to loop through cases in indexed order. You can change things to go in descending order:
https://www.csprousers.org/help/CSPro/s ... ement.html
If you really needed access to the sequential order, you can use the sqlquery function, but I wouldn't suggest creating an application where this was necessary. This, however, would get you what you want:
https://www.csprousers.org/help/CSPro/s ... ement.html
If you really needed access to the sequential order, you can use the sqlquery function, but I wouldn't suggest creating an application where this was necessary. This, however, would get you what you want:
list string sequential_keys;
sqlquery(SECOND_DICT, sequential_keys, "SELECT `key` FROM `cases` ORDER BY `file_order`;");
do numeric counter = 1 while counter <= length(sequential_keys)
locate(SECOND_DICT, =, sequential_keys(counter));
loadcase(SECOND_DICT);
// do something
enddo;
sqlquery(SECOND_DICT, sequential_keys, "SELECT `key` FROM `cases` ORDER BY `file_order`;");
do numeric counter = 1 while counter <= length(sequential_keys)
locate(SECOND_DICT, =, sequential_keys(counter));
loadcase(SECOND_DICT);
// do something
enddo;