End; {PurgeFiles}
goto
goto goto
goto
goto
goto goto
if if if
goto
Pascal if goto:
procedure PurgeFiles( var ErrorState : ERROR_CODE );
{This routine pruges a group of files.}
var
FileIndex : Ingeter;
FileHandle : FILEHANDLE_T;
FileList : FILELIST_T;
NumFilesToPurges: Integer;
begin
MakePurgeFileList( FileList , NumFilesToPurge );
ErrorState := Success;
FileIndex := 0;
While ( FileIndex < NumFilesToPurge and ErrorState = Success ) do While
begin
FileIndex := FileIndex + 1 ;
If FindFile ( FileList[ FileIndex ] , FileHandle ) then
Begin
If OpenFile ( FileHandle ) then
begin
If OverWriteFile ( FileHandle ) then
Begin
If not Erase ( FileHandle ) then
Begin
ErrorState := FileEraseError
End