home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / JBCOMM50.ZIP / COMMTEST.PAS next >
Encoding:
Pascal/Delphi Source File  |  1989-01-29  |  6.0 KB  |  204 lines

  1. program commtest;
  2.  
  3. uses crt,jbcomm50,modem7;
  4.  
  5. var ch        : char;
  6.     comport   : porttype;
  7.     result,
  8.     i         : integer;
  9.     quit      : boolean;
  10.     name      : filestr;
  11.  
  12. begin
  13.   assign(output,'');
  14.   rewrite(output);
  15.   directvideo:=false;
  16.   comport:=com5;
  17.   c_open(comport,2400,p_none,8,1,9192,256);
  18.   quit:=false;
  19.   repeat
  20.     if keypressed then
  21.     begin
  22.       ch:=readkey;
  23.       if ch<>#0 then
  24.         c_putc(comport,ch)
  25.       else
  26.       begin
  27.         name:=' ';
  28.         ch:=readkey;
  29.         case ch of
  30.           #68:quit:=true;
  31.           #59:begin
  32.                 i:=0;
  33.                 while (name<>'') and (i<1) do
  34.                 begin
  35.                   write('Enter name: ');
  36.                   readln(name);
  37.                   if name<>'' then
  38.                   begin
  39.                     addfile(comport,name);
  40.                     inc(i)
  41.                   end
  42.                 end;
  43.                 if i>0 then
  44.                 begin
  45.                   result:=tmodem7(comport,'',xmodem_crc);
  46.                   writeln(result,' files sent.');
  47.                 end
  48.               end;
  49.           #60:begin
  50.                 i:=0;
  51.                 while (name<>'') and (i<1) do
  52.                 begin
  53.                   write('Enter name: ');
  54.                   readln(name);
  55.                   if name<>'' then
  56.                   begin
  57.                     addfile(comport,name);
  58.                     inc(i)
  59.                   end
  60.                 end;
  61.                 if i>0 then
  62.                 begin
  63.                   result:=tmodem7(comport,'',xmodem_chk);
  64.                   writeln(result,' files sent.');
  65.                 end
  66.               end;
  67.           #61:begin
  68.                 i:=0;
  69.                 while (name<>'') do
  70.                 begin
  71.                   write('Enter name: ');
  72.                   readln(name);
  73.                   if name<>'' then
  74.                   begin
  75.                     addfile(comport,name);
  76.                     inc(i)
  77.                   end
  78.                 end;
  79.                 if i>0 then
  80.                 begin
  81.                   result:=tmodem7(comport,'',modem7_crc);
  82.                   writeln(result,' files sent.');
  83.                 end
  84.               end;
  85.           #62:begin
  86.                 i:=0;
  87.                 while (name<>'') do
  88.                 begin
  89.                   write('Enter name: ');
  90.                   readln(name);
  91.                   if name<>'' then
  92.                   begin
  93.                     addfile(comport,name);
  94.                     inc(i)
  95.                   end
  96.                 end;
  97.                 if i>0 then
  98.                 begin
  99.                   result:=tmodem7(comport,'',modem7_chk);
  100.                   writeln(result,' files sent.');
  101.                 end
  102.               end;
  103.           #63:begin
  104.                 i:=0;
  105.                 while (name<>'') do
  106.                 begin
  107.                   write('Enter name: ');
  108.                   readln(name);
  109.                   if name<>'' then
  110.                   begin
  111.                     addfile(comport,name);
  112.                     inc(i)
  113.                   end
  114.                 end;
  115.                 if i>0 then
  116.                 begin
  117.                   result:=tmodem7(comport,'',telink);
  118.                   writeln(result,' files sent.');
  119.                 end
  120.               end;
  121.           #64:begin
  122.                 i:=0;
  123.                 while (name<>'') and (i<1) do
  124.                 begin
  125.                   write('Enter name: ');
  126.                   readln(name);
  127.                   if name<>'' then
  128.                   begin
  129.                     addfile(comport,name);
  130.                     inc(i)
  131.                   end
  132.                 end;
  133.                 if i>0 then
  134.                 begin
  135.                   result:=tmodem7(comport,'',ymodem);
  136.                   writeln(result,' files sent.');
  137.                 end
  138.               end;
  139.           #65:begin
  140.                 i:=0;
  141.                 while (name<>'') do
  142.                 begin
  143.                   write('Enter name: ');
  144.                   readln(name);
  145.                   if name<>'' then
  146.                   begin
  147.                     addfile(comport,name);
  148.                     inc(i)
  149.                   end
  150.                 end;
  151.                 if i>0 then
  152.                 begin
  153.                   result:=tmodem7(comport,'',ymodem_batch);
  154.                   writeln(result,' files sent.');
  155.                 end
  156.               end;
  157.           #104:begin
  158.                  result:=rmodem7(comport,'',xmodem_chk);
  159.                  writeln('Received ',result,' files');
  160.                  repeat until getfile(comport)=''
  161.                end;
  162.           #105:begin
  163.                  result:=rmodem7(comport,'',xmodem_crc);
  164.                  writeln('Received ',result,' files');
  165.                  repeat until getfile(comport)=''
  166.  
  167.                end;
  168.           #106:begin
  169.                  result:=rmodem7(comport,'',modem7_chk);
  170.                  writeln('Received ',result,' files');
  171.                  repeat until getfile(comport)=''
  172.  
  173.                end;
  174.           #107:begin
  175.                  result:=rmodem7(comport,'',modem7_crc);
  176.                  writeln('Received ',result,' files');
  177.                  repeat until getfile(comport)=''
  178.  
  179.                end;
  180.           #108:begin
  181.                  result:=rmodem7(comport,'',telink);
  182.                  writeln('Received ',result,' files');
  183.                  repeat until getfile(comport)=''
  184.  
  185.                end;
  186.           #109:begin
  187.                  result:=rmodem7(comport,'',ymodem);
  188.                  writeln('Received ',result,' files');
  189.                  repeat until getfile(comport)=''
  190.  
  191.                end;
  192.           #110:begin
  193.                  result:=rmodem7(comport,'',ymodem_batch);
  194.                  writeln('Received ',result,' files');
  195.                  repeat until getfile(comport)=''
  196.  
  197.                end
  198.         end
  199.       end
  200.     end;
  201.     if c_inready(comport)>0 then write(c_getc(comport))
  202.   until quit;
  203.   c_close(comport,true)
  204. end.