(FILECREATED "17-Jan-85 14:32:07" {ERIS}<SPEECH>MAILREADER>TALK.;3 5735   

      changes to:  (FNS PROSE.ESC.SEQ)

      previous date: "11-Jan-85 12:55:45" {ERIS}<SPEECH>MAILREADER>TALK.;2)


(PRETTYCOMPRINT TALKCOMS)

(RPAQQ TALKCOMS [(FNS CLEAR.PROSE P.ESC.SEQ P.READBUFFER P.RESET PHONEMEMODE PROSE.COMMENCE.OUTPUT 
		      PROSE.ESC.SEQ PROSE.RESET PROSE.STOP READPORT RESET.PROSE SAY)
		 (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA)
										       (NLAML)
										       (LAMA 
											P.ESC.SEQ])
(DEFINEQ

(CLEAR.PROSE
  [LAMBDA NIL                                                (* mmw: "20-Sep-84 21:37")
    (RS232CLEARBUFFER (QUOTE BOTH))
    (for BYTE in (LIST 27 (CHCON1 (QUOTE %[))
		       (CHCON1 (QUOTE C)))
       do (RS232WRITEBYTE BYTE T) finally (PROGN (RS232WRITEBYTE 18)
						 (RS232FORCEOUTPUT])

(P.ESC.SEQ
  [LAMBDA args                                               (* pkh: "22-Oct-84 11:28")
    (PROG NIL                                                (* RS232WRITEBYTE 27)
                                                             (* RS232WRITECHARS (QUOTE %[))
          (for i from 2 to (SUB1 args)
	     do (PRINT (MKSTRING (ARG args i)))
		(PRINT (QUOTE ;)))
          [COND
	    ((IGEQ args 2)
	      (PRINT (MKSTRING (ARG args args]
          (PRINT (ARG args 1)
		 T])

(P.READBUFFER
  [LAMBDA NIL                                                (* mmw: "19-Oct-84 17:09")
                                                             (* Read RS232 input buffer until it is empty, find what
							     characters the bytes correspond to and return them as a
							     string)
    (for X while (SETQ X (RS232READBYTE)) collect X finally (RETURN (PACK (for X in $$VAL
									     collect (CHARACTER
										       X])

(P.RESET
  [LAMBDA (PRINTOUT)                                         (* pkh: "21-Nov-84 10:28")
    (RS232WRITEBYTE 18 T)                                    (* Sending <DC2>)
    (BLOCK 6000)
    (COND
      (PRINTOUT (printout T "Prose returned: " (P.READBUFFER)
			  T])

(PHONEMEMODE
  [LAMBDA (ON/OFF)                                           (* mmw: "20-Sep-84 15:36")

          (* * comment)


    (PROG (OUTPUTBYTES)
          (RS232WRITEBYTE 27)
          (RS232WRITEBYTE 91)
          (if (EQ ON/OFF (QUOTE ON))
	      then (RS232WRITECHARS "1I")
	    elseif (RS232WRITECHARS "0I"))
          (for BYTE in OUTPUTBYTES do (RS232WRITEBYTE BYTE T) finally (RS232FORCEOUTPUT))
          (RS232FORCEOUTPUT)
          (RETURN (READPORT])

(PROSE.COMMENCE.OUTPUT
  [LAMBDA NIL                                                (* mmw: "19-Oct-84 16:48")

          (* * comment)


    (RS232WRITEBYTE 27)
    (RS232WRITECHARS "[C" T])

(PROSE.ESC.SEQ
  [LAMBDA (SEQUENCE)                                         (* edited: "17-Jan-85 14:27")
    (RS232WRITEBYTE 27)
    (RS232WRITEBYTE 91)
    (RS232WRITECHARS SEQUENCE)
    (RS232FORCEOUTPUT])

(PROSE.RESET
  [LAMBDA NIL                                                (* pkh: "21-Nov-84 10:28")
    (RS232CLEARBUFFER (QUOTE BOTH))
    (RS232WRITEBYTE 18 T)
    (printout T "Waiting for 6 secs.......")
    (BLOCK 6000)
    (printout T T "Prose returned:  " (P.READBUFFER)
	      T])

(PROSE.STOP
  [LAMBDA NIL                                                (* mmw: "20-Sep-84 21:52")
    (PROSE.ESC.SEQ (QUOTE S])

(READPORT
  [LAMBDA NIL                                                (* pkh: "21-Nov-84 12:02")
    (for BYTE while [NOT (NULL (SETQ BYTE (RS232READBYTE] collect BYTE finally (RETURN $$VAL])

(RESET.PROSE
  [LAMBDA NIL                                                (* mmw: "18-Sep-84 15:27")

          (* * comment)


    (PROG (OUTPUTBYTES)
          [SETQ OUTPUTBYTES (APPEND OUTPUTBYTES (LIST 27 (CHCON1 (QUOTE %[))
						      0
						      (CHCON1 (QUOTE I]
          (for BYTE in OUTPUTBYTES do (RS232WRITEBYTE BYTE) finally (RS232FORCEOUTPUT])

(SAY
  [LAMBDA (INSTRING)                                         (* pkh: "21-Nov-84 10:28")
                                                             (* FOR BYTE IN OUTPUTBYTES DO 
							     (RS232WRITEBYTE BYTE) FINALLY 
							     (RS232FORCEOUTPUT))

          (* * comment)


    (PROG ((STRING (SUBSTRING INSTRING 1))
	   CHAR OUTPUTBYTES PHONEMEMODE (ESCAPECHAR (CHCON1 (QUOTE ←)))
	   (PORTCONTENT.BEFORE (READPORT)))
          (PROSE.RESET)
          (BLOCK 3000)
          (SETQ PORTCONTENT.BEFORE (READPORT))
          [while (SETQ CHAR (GNC STRING))
	     do [COND
		  ((EQ (CHCON1 CHAR)
		       ESCAPECHAR)
		    (SETQ PHONEMEMODE (NOT PHONEMEMODE))
		    (COND
		      (PHONEMEMODE (PHONEMEMODE (QUOTE ON)))
		      (T (PHONEMEMODE (QUOTE OFF]
		(RS232WRITEBYTE (CHCON1 (TRANSCRIPT CHAR]
          (PROSE.COMMENCE.OUTPUT)
          (RETURN (LIST PORTCONTENT.BEFORE (READPORT])
)
(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML )

(ADDTOVAR LAMA P.ESC.SEQ)
)
(PUTPROPS TALK COPYRIGHT (NONE))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (555 5539 (CLEAR.PROSE 565 . 940) (P.ESC.SEQ 942 . 1517) (P.READBUFFER 1519 . 2037) (
P.RESET 2039 . 2348) (PHONEMEMODE 2350 . 2906) (PROSE.COMMENCE.OUTPUT 2908 . 3119) (PROSE.ESC.SEQ 3121
 . 3353) (PROSE.RESET 3355 . 3679) (PROSE.STOP 3681 . 3826) (READPORT 3828 . 4064) (RESET.PROSE 4066
 . 4494) (SAY 4496 . 5537)))))
STOP