cfad47cfa3/t3compiler/tads3/test/data/resfile.t

4b825dc642cb6eb9a060e54bf8d69288fbee4904cfad47cfa334b206c65f22086bcc5d63e6f70944
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
    "&lt;&lt;EOF>>\b";
27
}