1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35:
| function Dateipfad: string; var Pathfile:file of string[75]; Dat, Path:string; begin writeLN('- Try to get file path'); Dat:=ExtractFilePath(ParamStr(0)) + 'path.txt'; if FileExists(Dat) then begin AssignFile(Pathfile,Dat); Reset(Pathfile); Read(Pathfile,Path); writeLN('- File path loaded successfully'); writeLN(Path); RESULT:=Path; end else begin writeLN('- Loading file path failed'); end; end;
begin writeLN('- Try to delete'); if DeleteFile(Dateipfad+'\Data\Save.dat') then writeLN('- file deleted successfully') else writeLN('- file not deleted or found'); ShellExecute(0,'open', PChar(Dateipfad+'\XY.exe'), Nil, Nil, SW_Normal); write('Press Enter to close.'); ReadLN; end. |