home *** CD-ROM | disk | FTP | other *** search
- (*----------------------------------------------------------------------*)
- (* DUMBTERM.PAS --- Emulate Dumb Terminal for PIBTERM *)
- (*----------------------------------------------------------------------*)
- (* *)
- (* Author: Philip R. Burns *)
- (* Date: January, 1985 *)
- (* Version: 1.0 *)
- (* Systems: For MS-DOS on IBM PCs and close compatibles only. *)
- (* Note: I have checked these on Zenith 151s under *)
- (* MSDOS 2.1 and IBM PCs under PCDOS 2.0. *)
- (* *)
- (* Needs: The Menu routines from MENUS.PAS, communications routines *)
- (* from ASYNC.PAS, and various global variables from *)
- (* PIBTERM.PAS. *)
- (* *)
- (* History: Original with me. *)
- (* *)
- (* Suggestions for improvements or corrections are welcome. *)
- (* Please leave messages on Gene Plantz's BBS (312) 882 4145 *)
- (* or Ron Fox's BBS (312) 940 6496. *)
- (* *)
- (* If you use this code in your own programs, please be nice *)
- (* and give proper credit. *)
- (* *)
- (*----------------------------------------------------------------------*)
-
- Procedure Emulate_Dumb_Terminal;
-
- (* *)
- (* Procedure: Emulate_Dumb_Terminal *)
- (* *)
- (* Purpose: Controls dumb terminal emulation *)
- (* *)
- (* Calling Sequence: *)
- (* *)
- (* Emulate_Dumb_Terminal; *)
- (* *)
- (* Calls: Async_Send *)
- (* Async_Receive *)
- (* KeyPressed *)
- (* Process_Command *)
- (* Display_Character *)
- (* ClrScr *)
- (* *)
- (* Remarks: *)
- (* *)
- (* You can replace this with something smarter --- i.e., *)
- (* a VT100 emulator, or whatever you like. *)
- (* *)
-
- Var
- Done: Boolean (* TRUE to exit terminal emulation mode *);
- Ch : Char (* Character read/written *);
-
- Begin (* Emulate_Dumb_Terminal *)
-
- ClrScr;
- Writeln('Beginning Dumb Terminal Emulation');
-
- Done := FALSE;
- (* Loop over input until done *)
- While ( NOT Done ) DO
- Begin
-
- If KeyPressed Then
- Begin
- Read( Kbd , Ch );
-
- Case ORD( Ch ) Of
-
- ESC: Process_Command( Done, Ch, FALSE );
-
- BS: Begin
- Ch := BS_Char;
- If Local_Echo Then Write( Ch );
- Async_Send( Ch );
- End;
-
- DEL: Begin
- Ch := Ctrl_BS_Char;
- If Local_Echo Then Write( Ch );
- Async_Send( Ch );
- End;
-
- Else
- Begin
- If Local_Echo Then Write( Ch );
- Async_Send( Ch );
- End;
-
- End (* CASE ORD( Ch ) *);
-
- End;
-
- If Async_Receive( Ch ) Then Display_Character( Ch );
-
- End;
-
- End (* Emulate_Dumb_Terminal *);