| 1 |
/* |
| 2 |
* @progname test_othr_it |
| 3 |
* @version 1 |
| 4 |
* @author Stephen Dum |
| 5 |
* @category self-test |
| 6 |
* @output text |
| 7 |
* @description |
| 8 |
* |
| 9 |
* test iterators: forsour, foreven, forothr |
| 10 |
* Iterate over some data, printing results, so we can |
| 11 |
* compare the output with exected results. |
| 12 |
*/ |
| 13 |
proc main() { |
| 14 |
print(nl()) |
| 15 |
print("forsour\n") |
| 16 |
forsour(s,c) { |
| 17 |
print(d(c),": ",key(s),nl()) |
| 18 |
} |
| 19 |
print("foreven\n") |
| 20 |
foreven(e,c) { |
| 21 |
print(d(c),": ",key(e),nl()) |
| 22 |
} |
| 23 |
print("forothr\n") |
| 24 |
forothr(s,c) { |
| 25 |
print(d(c),": ",key(s),nl()) |
| 26 |
} |
| 27 |
} |