home *** CD-ROM | disk | FTP | other *** search
- { DUMBTERM
- Plain vanilla comm program to demonstrate SUPERCOM.PAS
-
- (C) Copyright 1986, Doctor Debug/Steel City Software
- All Rights Reserved
-
- SUPER.COM must be loaded for this program to function correctly
-
- Do not run this program from the Turbo environment! Compile to a COM
- file first!
-
- To exit program, type Ctrl-Z
- }
-
- {$ISupercom.Pas} {Bring in Comm library}
-
- Var
- x:LString; {255 byte string - defined in SUPERCOM library}
- a,a1:char;
- i,b,c:integer;
- FilVar: Text;
- FileName: String[14];
- KeyCode: Byte;
-
- {$iGetChar} {Routine to Read Char from Keyboard}
-
- Begin {Main Program}
- If not(SuperComPresent) then
- Begin
- Writeln ('Sorry, but SUPER.COM must be loaded in order to run Dumbterm.');
- Halt;
- End;
- writeln ('Opening Supercom Port');
- InitPort(1,1200,Even,7,1); {opens port 1}
- Writeln(Lst,'Port opened');
- ClearBuff; {make sure buffer empty}
- Writeln(Lst,'Buffer cleared');
- FileName := 'TEXT.TXT';
- Assign(FilVar,FileName); {open file for capture}
- Rewrite(FilVar); {write from beginning}
- a := ' ';
- while a <> Chr(26) {26 = end of file char}
- Begin
- if keypressed then {this loop if key was pressed}
- begin
- a := GetChar; {get keypress}
- If a <> chr(26) then {control Z? (signifies end)}
- XmitCh(a); {no, send character}
- end;
- c := rlen; {# of chars in input buffer}
- If c <> 0 then {this loop if there are chars}
- begin
- if abs(c) > 255 then {only get blocks of 255}
- c := 255;
- recblk(c,x); {input data into x array}
- Write(x);
- Write(FilVar,x);
- end; {if}
- end; {while}
- Close(FilVar); {close output file}
- ClosePort; {close Supercom port}
- end. {Done!}