home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / XTALK1.ZIP / TYPE.XWS < prev    next >
Encoding:
Text File  |  1990-04-30  |  1.5 KB  |  59 lines

  1. /*
  2.     Type a File to the Screen
  3.  
  4.     This script will print the contents of a text file,
  5.     23 lines at a time, in the Crosstalk Window.
  6.  
  7.     Copyright (C) 1989, 1990 Digital Communications Associates, Inc.
  8.     All rights reserved.
  9.  
  10.     Version 1.0 07-01-89 PJL
  11. */
  12.  
  13.  
  14.         string fname, fstr, ans
  15.         integer row
  16.  
  17.  
  18.         cls
  19.         fname = arg(1)
  20.         if null(fname) then {
  21.                 alert "Enter filename: ", OK, CANCEL, fname
  22.                 if choice = 2 then end
  23.         }
  24.  
  25.         if not exists(fname) then {
  26.                 tname = fname
  27.                 fname = DirFil + "\" + tname
  28.                 if not exists(fname) then {
  29.                         fname = DirXws + "\" + tname
  30.                         if not exists(fname) then {
  31.                                 print "Can't find file ";tname
  32.                                 end
  33.                         }
  34.                 }
  35.         }
  36.  
  37.         chan = freefile
  38.         open input fname as #chan
  39.         if not chan then {
  40.                 print "Too many open files."
  41.                 end
  42.         }
  43.         row = 1
  44.         while not eof(chan)
  45.                 read line #chan, fstr
  46.                 print left(fstr,winsizex)
  47.                 if row = 23 then {
  48.                         alarm
  49.                         message "   More ... Press Enter ..."
  50.                         while not inkey : wend
  51.                         message ""
  52.                         row = 1
  53.                 }
  54.                 else row = row + 1
  55.         wend
  56.         close #chan
  57.  
  58.  
  59.