ex44.pp 331 B

1234567891011121314151617
  1. Program Example44;
  2. { This program demonstrates the RenameFile function }
  3. Uses sysutils;
  4. Var F : Longint;
  5. S : String;
  6. Begin
  7. S:='Some short file.';
  8. F:=FileCreate ('test.dap');
  9. FileWrite(F,S[1],Length(S));
  10. FileClose(F);
  11. If RenameFile ('test.dap','test.dat') then
  12. Writeln ('Successfully renamed files.');
  13. End.