home *** CD-ROM | disk | FTP | other *** search
- program IBMCOMT;
- (* Simple test program for COM_MGR, strictly similar to Wayne E. Conrad's
- test program for his IBMCOM. Acts like a dumb terminal at a fixed
- speed and with no commands except for Esc to exit the program. Obviously
- it doesn't test all of COM_MGR, but it demonstrates the most important
- calls. *)
-
- uses
- CRT (* ClrScr, KeyPressed, ReadKey *),
- COM_MGR (* COM_CONFIGURATION, COM_INPUT_WAITING, COM_RAISE_DTR, COM_READ,
- COM_VERSION, COM_WRITE_CH, COM1, INIT_COM_MGR, NO_PARITY,
- ONE_STOP_BIT, TERM_COM_MGR *);
-
- const
- ALTX = #45;
-
- var
- ALTX_RECEIVED: boolean;
- CH: char;
-
- begin (* IBMCOMT *)
- with COM_CONFIGURATION do
- begin (* tell COM_MGR how to start *)
- FILED_VERSION := COM_VERSION;
- NEED_DSR := true;
- USING_DTR := true;
- USING_XOFF := false;
- THESE_DATA_BITS := 7;
- THIS_BAUD := 2400;
- THIS_PARITY := NO_PARITY;
- THIS_PORT := COM1;
- THESE_STOP_BITS := ONE_STOP_BIT
- end (* tell COM_MGR how to start *);
- INIT_COM_MGR;
- COM_RAISE_DTR;
- ClrScr;
- ALTX_RECEIVED := false;
-
- repeat (* process remote character *)
- if KeyPressed then
- begin (* might be extended *)
- CH := ReadKey;
- if CH <> #0 then
- COM_WRITE_CH(CH)
- else
- ALTX_RECEIVED := (ReadKey = ALTX)
- end (* might be extended *);
-
- if COM_INPUT_WAITING > 0 then
- write(COM_READ)
- until (* process remote character *) ALTX_RECEIVED;
-
- TERM_COM_MGR
- end (* IBMCOMT *).