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 / DEFAULT.INC < prev    next >
Text File  |  1987-02-22  |  3KB  |  130 lines

  1.  
  2. {********** default.inc **********}
  3.      { default & miscellaneous }
  4.  
  5. procedure next_command;
  6. {do next command from command file}
  7. var
  8.   cfile : text;
  9. begin
  10.   sourceName:= 'PMODEM.CMD';
  11.   if not do_command then write(^G);
  12.   if not do_command then
  13.    if findfile(sourceName) then begin
  14.     do_command:= true;
  15.     assign(cfile, SourceName);
  16.     reset(cfile);
  17.    end
  18.    else begin
  19.     writeln;
  20.     writeln(^G, '++ command file not found ++');
  21.     writeln;
  22.     command_file:= false;
  23.     eraseOK:= false;
  24.    end;
  25.   if do_command then begin
  26.     delay(1000);
  27.     write(^G);
  28.    if not EOF(cfile) then readln(cfile, line)
  29.     else begin
  30.       command_file:= false;
  31.       do_command:= false;
  32.       close(cfile);
  33.     end;
  34.   end;
  35. end; {next_command}
  36.  
  37. procedure do_wait;
  38. var
  39.   rnumb: real;
  40.   count, number : integer;
  41. begin
  42.   writeln('WAIT');
  43.   writeln;
  44.   write('Enter TIME to wait (minutes): ');
  45.   readln(rnumb);
  46.   if rnumb< 0 then rnumb:= 0;
  47.   count:= round(600 * rnumb);
  48.   for number:= 1 to count do
  49.     delay(100);
  50.   write(^G);
  51. end; {do_wait}
  52.  
  53. procedure disconnect;
  54. begin
  55.   if carrier then begin
  56.     writeln('--> disconnecting...');
  57.     go_onHook;
  58.   end;
  59. end; {disconnect}
  60.  
  61. procedure default;
  62. var
  63.   local: data;
  64.  
  65. procedure writebool(toot: boolean);
  66. begin
  67.   if toot then writeln('On')
  68.   else writeln('Off');
  69. end; {writebool}
  70.  
  71. procedure prompt;
  72. begin
  73.   write('Enter new VALUE -- ');
  74. end; {prompt}
  75.  
  76. procedure default_menu;
  77. begin
  78.     if eraseOK then clrScr;
  79.     eraseOK:= true;
  80.     writeln('DEFAULTS');
  81.     writeln;
  82.     write('1. BAUD     ');
  83.       if hiBaud then writeln('1200')
  84.       else writeln('300');
  85.     write('2. DUPLEX   ');
  86.       if duplex then writeln('Full')
  87.       else writeln('Half (echo)');
  88.     write('3. CAPTURE  ');
  89.       writebool(capture);
  90.     write('4. FILTER   ');
  91.       writebool(filter);
  92.     write('5. DELAY    ');
  93.       writebool(delay_set);
  94.     writeln('6. WAIT     ', wait, ' mins');
  95.     write('7. COMMAND FILE ');
  96.       writebool(command_file);
  97.     write('8. LOGON    ');
  98.       writebool(log_on);
  99.     writeln;
  100. end;  {default_menu}
  101.  
  102. begin  {default}
  103.   if first then begin
  104.   {initialize modem}
  105.     init_modem;
  106.     modem_out_line('AT M1 S0=0'); {disable auto answer}
  107.   end
  108.   else
  109.   Repeat
  110.     default_menu;
  111.     write('Enter NUMBER to toggle or change / <RET> for main menue: ');
  112.     readln(local);
  113.     if length(local)= 0 then local:= '0';
  114.     case local[1] of
  115.      '1': if hibaud then set_loBaud else set_hiBaud;
  116.      '2': duplex:= not duplex;
  117.      '3': capture:= not capture;
  118.      '4': filter:= not filter;
  119.      '5': delay_set:= not delay_set;
  120.      '6': begin
  121.            prompt;
  122.            readln(wait);
  123.           end;
  124.      '7': command_file:= not command_file;
  125.      '8': log_on:= not log_on;
  126.     end;
  127.   Until local = '0';
  128. end; {default}
  129.  
  130.