home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / TURBOPAS / PMODEM.ARK / MAIN.INC < prev    next >
Text File  |  1987-02-22  |  2KB  |  87 lines

  1.  
  2. {********** main program loop **********}
  3. procedure main_menue;
  4. begin
  5.   timeout;
  6.   if first then begin
  7.     default;
  8.     eraseOK:= false;
  9.     if length(line)= 0 then line:= 'C'; {call}
  10.     if carrier then line:= '';
  11.     first:= false;
  12.   end;
  13.   if (length(line)= 0) and not command_file then begin
  14.     if eraseOK then resetCRT;
  15.     eraseOK:= true;
  16.     write('        Main Menue ');
  17.     if carrier then writeln('(carrier)') else writeln('(no carrier)');
  18.     writeln;
  19.       if not carrier then begin
  20.         writeln('(C)all                    (H)ost mode');
  21.         writeln('(T)erminal mode           (D)efaults');
  22.         writeln('(W)ait                    (Q)uit');
  23.       end
  24.       else begin {carrier}
  25.         writeln('(T)erminal mode                (W)ait');
  26.         writeln('(S)end a file (XMODEM)         (D)efaults');
  27.         writeln('  (SA) ASCII text              (X) Disconnect');
  28.         writeln('(R)eceive a file (XMODEM)      (Q)uit');
  29.         writeln('  (RC) Checksum  (RX) CRC');
  30.       end;
  31.       writeln;
  32.       write('Enter SELECTION: ');
  33.       readln(line);
  34.   end;
  35. end; {main_menu}
  36.  
  37. procedure action;
  38. begin
  39.   if command_file then next_command;
  40.   if length(line)= 0 then line:= 'Y';
  41.   case upCase(line[1]) of
  42.      'C': begin
  43.             if eraseOK then clrScr;
  44.             call;
  45.           end;
  46.      'T': begin
  47.             if eraseOK then clrScr;
  48.             terminal_mode;
  49.           end;
  50.      'K': port[StatusPort]:= $35;  {command byte}
  51.      {*** remember 'timein' if disk access ***}
  52.      'S': send_a_file;
  53.      'R': receive_a_file;
  54.      'A': send_ascii;
  55.      'H': begin
  56.             if eraseOK then clrScr;
  57.             host;
  58.           end;
  59.      'W': do_wait;
  60.      'D': default;
  61.      'X': begin
  62.             if eraseOK then clrScr;
  63.             eraseOK:= false;
  64.             disconnect;
  65.           end;
  66.      'Q': timein;
  67.   end;
  68.   if line[1] in ['Q', 'q'] then line:= 'Q' else line:= '';
  69. end; {action}
  70.  
  71. {********** program starts here **********}
  72. begin
  73.    line:= getTail; {CP/M command tail}
  74.    first:= true;
  75.    clrScr;
  76.    writeln(^I^I + 'P M O D E M  v1.1a communications program');
  77.    writeln;
  78.    repeat
  79.    {this is the main program loop}
  80.      main_menue;
  81.      action;
  82.    until line= 'Q';
  83.    writeln;
  84.    disconnect;
  85.    writeln('++ Return to System ++');
  86. end. {program}
  87.