home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / lan / install.pas < prev    next >
Pascal/Delphi Source File  |  1988-06-23  |  7KB  |  208 lines

  1. program makedir(input,output);
  2.  
  3.    {
  4.  
  5.    Program accepts information from the user and makes the file
  6.    'lan.bat'.
  7.  
  8.    }
  9.  
  10. const
  11.   version = '1.00';
  12.   progname = 'INSTALL ';
  13.   ctlh = #08;
  14.   cret = #13;
  15.   linf = #10;
  16.   ctrlz= #26;
  17.  
  18. type
  19.   string2=string[2];
  20.   string3=string[3];
  21.  
  22.  
  23. var
  24.   outfiler:text;
  25.   ch:char;
  26.   floppydrive,
  27.   harddrive:char;
  28.   output_file:string[12];
  29.   trimmer:string[4];
  30.  
  31. procedure databox;
  32. begin
  33. gotoxy(7,6);
  34. write ('Floppy Drive:   ',floppydrive);
  35. gotoxy(7,7);
  36. write ('  Hard Drive:   ',harddrive);
  37. gotoxy(7,8);
  38. write ('   Data List:   ',output_file,'          ');
  39. gotoxy(6,9);
  40. if trimmer = 'TRIM' then
  41. write('Trim function:   ON     ')
  42. else
  43. write('Trim function    off    ');
  44. gotoxy(3,19);
  45. write(' ');
  46. end;
  47.  
  48. procedure boxlike;
  49.  
  50. begin
  51. clrscr;
  52. gotoxy(0,0);
  53. writeln ('┌─────────────────────────────────────────────────────────────────────────────┐');
  54. writeln ('│                                                                             │');
  55. writeln ('│                                                                             │');
  56. writeln ('│                                                                             │');
  57. writeln ('│                                                                             │');
  58. writeln ('│                                                                             │');
  59. writeln ('│                                                                             │');
  60. writeln ('│                                                                             │');
  61. writeln ('│                                                                             │');
  62. writeln ('│                                                                             │');
  63. writeln ('│                                                                             │');
  64. writeln ('│                                                                             │');
  65. writeln ('└─────────────────────────────────────────────────────────────────────────────┘');
  66. writeln ('┌─────────────────────────────────────────────────────────────────────────────┐');
  67. writeln ('│  To change options, type (F)loppy drive, (H)ard drive, (L)an datafile       │');
  68. writeln ('│                          (T)rim capability or e(X)it.                       │');
  69. writeln ('└─────────────────────────────────────────────────────────────────────────────┘');
  70. gotoxy(29,3);
  71. write ('F L O P P Y  -  L A N');
  72. gotoxy(52,4);
  73. write ('System (C) by:');
  74. gotoxy(52,6);
  75. write ('Leonard P. Levine');
  76. gotoxy(52,7);
  77. write ('3942 N. Oakland Ave. #241');
  78. gotoxy(52,8);
  79. write ('Shorewood, WI 53211');
  80. gotoxy(52,9);
  81. write ('(414) 962-4719');
  82. gotoxy(52,10);
  83. write ('len@evax.milw.wisc.edu');
  84. gotoxy(3,12);
  85. write ('Program: ',progname);
  86. gotoxy(52,12);
  87. write('Version: ',version);
  88. databox;
  89. end;
  90.  
  91. procedure cleanup;
  92.   begin
  93.   gotoxy(3,19);
  94.   writeln ('                                                                      ');
  95.   writeln ('                                                                            ');
  96.   writeln ('                                                                            ');
  97.   writeln ('                                                                            ');
  98.   writeln ('                                                                            ');
  99.   writeln ('                                                                            ');
  100.   end;
  101.  
  102.  
  103. {main Program}
  104. begin
  105. floppydrive:= 'A';
  106. harddrive := 'C';
  107. output_file := 'LAN.FIL';
  108. trimmer := 'TRIM';
  109. boxlike;
  110. ch := ' ';
  111. while ch <> 'X' do
  112.   begin
  113.   write ('Enter option (F,H,L,T,X,?) ');
  114.   read (kbd,ch);
  115.   ch := upcase(ch);
  116.   case ch of
  117.     'F': begin
  118.            writeln ('Floppy Drive Change');
  119.            write   ('        Enter A or B: ');
  120.            floppydrive := ' ';
  121.            while not (floppydrive in ['A','B']) do
  122.              begin
  123.              read (kbd,floppydrive);
  124.              floppydrive := upcase(floppydrive);
  125.              end;
  126.            databox; cleanup;
  127.            end;
  128.     'H': begin
  129.            writeln ('Hard Drive Change');
  130.            write   ('        Enter C, D, E, or F: ');
  131.            harddrive := ' ';
  132.            while not (harddrive in ['C','D','E','F']) do
  133.              begin
  134.              read (kbd,harddrive);
  135.              harddrive := upcase(harddrive);
  136.              end;
  137.            databox; cleanup;
  138.            end;
  139.     'L': begin
  140.            writeln ('Change Lan Data File');
  141.            write   ('        Enter name of new Lan Data File: ');
  142.            readln (output_file);
  143.            if output_file = '' then output_file := 'LAN.FIL';
  144.            databox; cleanup
  145.            end;
  146.     'T': begin
  147.            writeln ('Change Trim Option');
  148.            write   ('        Should the TRIM function be turned ON (y,n): ');
  149.            while not (ch in ['Y','y','N','n']) do read (kbd,ch);
  150.            if upcase(ch) = 'Y' then trimmer := 'TRIM' else trimmer := '    ';
  151.            ch := ' ';
  152.            databox; cleanup
  153.            end;
  154.     'X': writeln ('eXit this Program');
  155.     '?': begin
  156.           writeln ('Help:');
  157.           writeln ('This program rewrites the LAN.BAT file with changes in the floppy and hard');
  158.           writeln ('drives and changes in the user data filename.  Each hard disk machine should');
  159.           writeln ('have its own version of LAN.BAT to permit appropriate choice of drives.  The');
  160.           writeln ('Trim Option permits much less space to be used on the floppy drive.');
  161.           write   ('Type any character: ');
  162.           read (kbd,ch);
  163.           cleanup;
  164.           end;
  165.     end;
  166.   gotoxy(3,21);
  167.   write(' ');
  168.   end;
  169. writeln;
  170. writeln;
  171. write  ('  Should I rewrite the LAN.BAT file (y,n): ');
  172. ch := ' ';
  173. while not (ch in ['Y','y','N','n']) do read (kbd,ch);
  174. if upcase(ch) = 'Y' then
  175.     begin
  176.     writeln;
  177.     writeln;
  178.     writeln ('   Updating LAN.BAT');
  179.     assign (outfiler,'LAN.BAT');
  180.     rewrite(outfiler);
  181.     writeln (outfiler,'@echo off');
  182.     writeln (outfiler,'rem programs install, lanmkdir and lancomp (C) L. P. Levine');
  183.     writeln (outfiler,'lanmkdir ',floppydrive,harddrive,' ',output_file);
  184.     writeln (outfiler,'command /c \lan\x1 ');
  185.     writeln (outfiler,'lancomp ',trimmer);
  186.     writeln (outfiler,'command /c \lan\x2');
  187.     writeln (outfiler,'del x?.?at');
  188.     close (outfiler);
  189.     end
  190.   else
  191.     begin
  192.     writeln;
  193.     writeln;
  194.     writeln ('   Not updating LAN.BAT');
  195.     end;
  196. end.
  197.  
  198. {
  199.  
  200. @echo off
  201. cd \lan
  202. lanmkdir AC LAN.FIL
  203. command /c \lan\x1
  204. lancomp TRIM
  205. command /c \lan\x2
  206. rem del x?.?at
  207.  
  208. }