This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.
Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.
We can delete all resources from a resource file simply by calling the Clear method of TPJResourceFile. In addition to deleting the resources Clear also frees all the TPJResourceEntry instances.
var
ResFile: TPJResourceFile;
begin
...
// Assume ResFile is a valid resource file object
...
// Delete all resources and free them
ResFile.Clear;
...
end;
A single resource can be removed from the resource file using the TPJResourceFile.DeleteEntry method. This checks if the resource file contains the resource and removes it from the file if so. However, the resource entry object is not freed. While this behaviour may be useful at times, it is not recommended for geral use. The preferred method is simply to free the resource entry instance. Freeing a TPJResourceEntry object automatically removes it from the resource file.
So, to remove a single resource, ResEntry, from the resource file use the following code:
var
Entry: TPJResourceEntry;
begin
...
// Assume ResEntry references a valid object
...
// Delete the object from its resource file and free it
Entry.Free;
...
end;
Links: