Important: The information in this document is obsolete and should not be used for new development.
Unique1ID
You can use theUnique1ID
function to get a resource ID that's unique with respect to resources in the current resource file.
FUNCTION Unique1ID (theType: ResType): Integer;
theType
- A resource type.
DESCRIPTION
TheUnique1ID
function returns as its function result a resource ID greater than 0 that isn't currently assigned to any resource of the specified type in the current resource file. You should use this routine before adding a new resource to ensure that you don't duplicate a resource ID and override an existing resource.SPECIAL CONSIDERATIONS
In versions of system software earlier than System 7, theUnique1ID
function may return a resource ID in the range 0 through 127, which is generally reserved for system resources. You should check that the resource ID returned is not in this range. If it is, callUnique1ID
again, and continue doing so until you get a resource ID greater than 127.In System 7 and later versions,
Unique1ID
won't return a resource ID of less than 128.SEE ALSO
To check for errors, call theResError
function as described on page 1-47.For more information about restrictions on resource IDs for specific resource types, see "Resource IDs" on page 1-42.