home *** CD-ROM | disk | FTP | other *** search
- program commtest;
-
- uses crt,jbcomm;
-
- var ch : char;
- i : integer;
- info : com_info_rec;
-
- begin
- c_port_info(com1,info);
- write('The port is ');
- if info.active then
- writeln('Active.')
- else
- writeln('not Active.');
- write('The interrupts are ');
- if info.ints_on then
- writeln('Active.')
- else
- writeln('not Active.');
- writeln('Speed = ',info.speed);
- write('Parity = ');
- case info.parity of
- p_none:writeln('NONE');
- p_even:writeln('EVEN');
- p_odd :writeln('ODD ');
- p_even_stick:writeln('EVEN w/STICK');
- p_odd_stick:writeln('ODD w/STICK')
- end;
- writeln('Data = ',info.data);
- writeln('Stops= ',info.stops);
- writeln('Hit CR to exit. ');
- c_open(com1,2400,p_none,8,1,4096,256);
- ch:=#0;
- repeat
- if keypressed then
- begin
- ch:=readkey;
- if ch<>#27 then c_putc(com1,ch)
- end;
- if c_inready(com1)>0 then write(c_getc(com1))
- until ch=#27;
- c_close(com1,true);
- c_port_info(com1,info);
- write('The port is ');
- if info.active then
- writeln('Active.')
- else
- writeln('not Active.');
- write('The interrupts are ');
- if info.ints_on then
- writeln('Active.')
- else
- writeln('not Active.');
- writeln('Speed = ',info.speed);
- write('Parity = ');
- case info.parity of
- p_none:writeln('NONE');
- p_even:writeln('EVEN');
- p_odd :writeln('ODD ');
- p_even_stick:writeln('EVEN w/STICK');
- p_odd_stick:writeln('ODD w/STICK')
- end;
- writeln('Data = ',info.data);
- writeln('Stops= ',info.stops);
- writeln('Hit CR to exit. ')
- end.