home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Pascal / Snippets / Pascal I⁄O Extensions / SampleIO.p < prev    next >
Encoding:
Text File  |  1996-12-17  |  897 b   |  49 lines  |  [TEXT/CWIE]

  1. Program HSetVolTest;
  2.  
  3. Uses
  4.     XPascalIO, Fonts;
  5.  
  6. { Test program for the XPascalIO unit.                }
  7. { Asks the user for an input and an output            }
  8. { file, and copies one to the other, while echoing    }
  9. { the contents to the text window.                    }
  10. { Greg Ewing, 1996                                    }
  11.  
  12. { Updated to a CodeWarrior project, 12/17/96, Bill Catambay }
  13.  
  14. Var
  15.     spec1, spec2:     FSSpec;
  16.     f1, f2:         text;
  17.     line:             Str255;
  18.  
  19. Procedure InitToolbox;
  20.  
  21.     begin
  22.     InitGraf(@qd.thePort);
  23.     InitFonts;
  24.     InitWindows;
  25.     InitMenus;
  26.     TEInit;
  27.     InitDialogs(NIL);
  28.     InitCursor;
  29.     MaxApplZone;
  30.     MoreMasters;
  31.     end;
  32.     
  33. begin
  34. InitToolbox;
  35. if GetOldFile('TEXT', spec1) then
  36.     if GetNewFile('Save copy as:', concat(spec1.name, ' copy'), spec2) then 
  37.         begin
  38.         FSpReset(f1, spec1);
  39.         FSpRewrite(f2, spec2, 'TEXT', 'PJMM');
  40.         while not eof(f1) do 
  41.             begin
  42.             readln(f1, line);
  43.             writeln(line);
  44.             writeln(f2, line);
  45.             end;
  46.         close(f1);
  47.         close(f2);
  48.         end;
  49. end.