›MODULE ; TERM2.ACT››; (c) 1983 ACS››; Copyright (c) 1983›; by Action Computer Services (ACS)›;›; No portion of this software may be›; incorporated within or included with›; another computer program that is to›; be sold to other parties in any›; manner without the express written›; permission of Action Computer›; Services. Under no circumstances is›; this copyright notice or others›; contained within this software to be›; removed.››; last modified October 24, 1983›››PROC CloseModem()› XOff()› › Delay(5)› WHILE MGet() DO ; flush buffer› Delay(3)› OD› Close(modem)›RETURN›››PROC Flush(BYTE chan, CHAR ARRAY addr, CARD size)› IF size THEN› WriteBlock(chan, addr, size)› OpenModem(translation)› XOn()› FI›RETURN›››PROC FlushPrinter()› CloseModem()› Flush(printer, pbuf, pindex)› pindex = 0› pcounter = 0› pincr = 0›RETURN›››PROC FlushFile()› CloseModem()› Flush(file, fbuf, findex)› findex = 0› fcounter = 0› fincr = 0›RETURN›››PROC MyClose(BYTE chan)› CloseModem()› Close(chan)› OpenModem(translation)›RETURN›››PROC ClosePrinter()› pbuf(pindex) = EOL› pindex = pindex + 1› FlushPrinter()› MyClose(printer)› PrintF("%Ebuffering off%E")› pflag = 0›RETURN›››PROC CloseFile()› FlushFile()› MyClose(file)› PrintF("%Edown load stopped%E")›RETURN›››PROC MyOpen(BYTE chan, STRING dev, BYTE mode, aux2)› CloseModem()› Close(chan)› CIO(chan,dev+1,dev(0),$3,mode,aux2)› EOF(chan) = 0› OpenModem(translation)›RETURN›››PROC OpenFile(STRING msg)› CHAR ch› BYTE i›› DO› CIO_status = 0›› Print(msg)› Zero(fname, 3)› InputMD(0, fname, 37)› IF fname(0)#0 THEN› IF fname(2)#': AND fname(3)#': THEN› ; fill in device name› i = fname(0) + 1 ; copy EOL as well› WHILE i>0 DO› fname(i+2) = fname(i)› i = i - 1› OD› fname(0) = fname(0) + 2› fname(1) = 'D› fname(2) = ':› FI›› ; make upper case› FOR i = 1 TO fname(0) DO› IF fname(i)>='a AND fname(i)<='z THEN› fname(i) ==& $DF› FI› OD›› MyOpen(file, fname, fmode, 0)› IF CIO_status>127 THEN› PrintF("%EERROR - %I, try again? ", CIO_status)› ch = GetD(key)› Put(ch) PutE()› IF (ch % $20)#'y THEN› fmode = 0› RETURN› FI› FI› ELSE› fmode = 0› FI› UNTIL CIO_status<128 OD›RETURN›››PROC ReadFile()› CloseModem()› fsize = ReadBlock(file, fbuf, fmax)› OpenModem(translation)› XOn()›RETURN›››CHAR FUNC FileChar()› CHAR ch› CARD i›› ch = fbuf(findex)› findex = findex + 1›› FOR i = 1 TO slow DO OD›› IF findex>=fsize THEN ; end of buffer› IF EOF(file) THEN ; end of file› MyClose(file)› PrintF("%Eup load done%E")› fflag = 0› fmode = 0› ELSE ; get another buffer worth› ReadFile()› findex = 0› FI› FI›RETURN(ch)››MODULE››