home *** CD-ROM | disk | FTP | other *** search
- #include <file.h>
-
- string filen[256]; string s[256]; string ch[2];
- int i; int maxlines;
-
- maxlines = 20;
-
- print "viewtext", /n;
- input "filename: " filen;
- if filen = "";
- exit;
- endif;
- print /n2;
-
- fopen 1, filen, "r";
- if _file = FILE_OPEN;
- print "can't open file!", /n;
- exit;
- endif;
-
- _file = FILE_OK; i = 0;
- while _file = FILE_OK;
- fread 1 s;
- if _file != FILE_EOF;
- print s; inc i;
- endif;
- if i = 20;
- ch = "";
- inputch "[RETURN: next lines, r: rewind] " ch;
- ucase ch;
- if ch = "R";
- frewind 1;
- endif;
-
- i = 0; print /n;
- endif;
- wend;
- fclose 1;
- print /n, "[end of file ", "'", filen, "']", /n;
-