terps/tads/tads3/test/data/resfile.t
raw| 1 | #charset "us-ascii" |
| 2 | |
| 3 | #include <tads.h> |
| 4 | #include <file.h> |
| 5 | |
| 6 | main(args) |
| 7 | { |
| 8 | local f; |
| 9 | |
| 10 | /* read a resource file */ |
| 11 | f = File.openTextResource('testres.txt', 'iso-8859-1'); |
| 12 | |
| 13 | /* read from the file until done */ |
| 14 | for (local linenum = 1 ; ; ++linenum) |
| 15 | { |
| 16 | local txt; |
| 17 | |
| 18 | /* read another line - stop at eof */ |
| 19 | if ((txt = f.readFile()) == nil) |
| 20 | break; |
| 21 | |
| 22 | /* show it */ |
| 23 | "<<linenum>>:<<txt.htmlify()>>"; |
| 24 | } |
| 25 | |
| 26 | "<<EOF>>\b"; |
| 27 | } |