22. Januar 2009 11:28
22. Januar 2009 14:14
CloseAndCreateNewFile(NewName : Text[250]) : Text[250]
IF NewName <> '' THEN BEGIN
Path := cuGenFuncs.GetFilePath(CurrFile.NAME);
Ext := cuGenFuncs.GetFileExt(OriginalFilename);
Name := COPYSTR(OriginalFilename, 1, STRLEN(OriginalFilename) - STRLEN(Ext) - 1);
CompleteNewName := cuGenFuncs.AddPath(Path, Name + '_' + NewName + '.' + Ext);
END ELSE BEGIN
CompleteNewName := Filename;
END;
LastFileName := CurrFile.NAME;
CurrFile.CLOSE;
CurrFile.OPEN(LastFileName);
IF CurrFile.LEN > 0 THEN BEGIN
CurrFile.SEEK(CurrFile.LEN - 2);
CurrFile.TRUNC;
END;
CurrFile.CLOSE;
IF EXISTS(CompleteNewName) THEN
ERASE(CompleteNewName);
CurrFile.CREATE(CompleteNewName);
22. Januar 2009 14:22