home *** CD-ROM | disk | FTP | other *** search
/ FMI Superhry 3 / Superhry-III.bin / DETSKE / MEMORY / FLOPPY.PAS < prev    next >
Pascal/Delphi Source File  |  1995-06-02  |  2KB  |  96 lines

  1. Program floppy;
  2.  
  3. {$M 4000, 0, 4000}
  4.  
  5. Uses
  6.  crt,
  7.  dos;
  8.  
  9. Var
  10.  Key,ciff:Char;
  11.  F:Text;
  12.  Lin,FilNavn: String;
  13.  Num,Old_Num:String[3];
  14.  Posit,start,j:byte;
  15. Const
  16.  Empty = '                                                      ';
  17. begin
  18. WriteLn;
  19. WriteLn('M E M O R Y');
  20. WriteLn('  copy to floppy program');
  21. WriteLn;
  22. Writeln('This program will copy the files of Memory to floppies in a way');
  23. WriteLn('so it can we installed from the floppies');
  24. WriteLn;
  25. WriteLn('You can do that to obtain a backup-copy of Memory or a copy');
  26. WriteLn('to give away to others - a copy easy to install.');
  27. WriteLn;
  28. WriteLn('You can use this program, if you have received Memory from a');
  29. WriteLn('or the Internet or zip''ed on floppies. When you unzip Memory to');
  30. WriteLn('your harddisk, all the files will be placed in one directory,');
  31. WriteLn('from where you can install it!');
  32. WriteLn('FLOPPY.EXE can''t be used to make a copy of the installed program!');
  33. WriteLn;
  34. WriteLn('Before you start, you need five FORMATTED and EMPTY HD-floppies,');
  35. WriteLn('labelled MEMORY 1 to 5.');
  36. WriteLn;
  37. WriteLn('Press <Enter> to procede, <Esc> to quit');
  38.  
  39. Key := '#';
  40. While Key <> #13 do
  41.  begin
  42.   Key := Readkey;
  43.   IF Key = #27 Then
  44.      Halt;
  45.  end;
  46.  
  47. Assign(F,'Install.inf');
  48. Reset(F);
  49. Repeat
  50.  ReadLn(F,Lin);
  51. Until Lin = ';begin';
  52. Old_Num:='';
  53. While not Eof(F) and (Lin <> ';end') do
  54.  begin
  55.   Lin := Empty;
  56.   ReadLn(F,Lin);
  57.   posit := Pos(':',Lin);
  58.   IF posit > 0 then
  59.    begin
  60.      For j := posit - 1 downto 0 do
  61.        begin
  62.        ciff := Lin[j];
  63.        Case ciff of
  64.         #49 .. #57:Start:=j;
  65.        End;
  66.       end;
  67.      Num:= Copy(Lin,start,Posit-start);
  68.      If Num <> Old_Num Then
  69.       begin
  70.        WriteLn;
  71.        WriteLn('Insert floppydisk '+Num+' in drive a:');
  72.        WriteLn('and press Enter!');
  73.        Old_Num := Num;
  74.        ReadLn;
  75.        SwapVectors; 
  76.        Exec (GetEnv('ComSpec'),' /C LABEL a:MEMORY'+Num);
  77.        SwapVectors;
  78.       end;
  79.       Filnavn:='';
  80.       For j:=posit+1 to posit+12 do
  81.        begin
  82.         Case lin[j] of
  83.            #42,#46,#48 .. #57,#63..#255:filnavn:=filnavn + lin[j];
  84.         end;
  85.        end;
  86.      posit:=Pos('.',FilNavn);
  87.      IF Length(Filnavn) > posit + 3 Then
  88.         FilNavn := Copy(Filnavn,1,posit+3); 
  89.      WriteLn('Copying .... '+FilNavn);
  90.       Exec (GetEnv('ComSpec'),' /C Copy '+FilNavn+' a:'+filNavn+' >NULL');
  91.    end;
  92.  
  93.   end;
  94.   Close(F);
  95. end.
  96.