Important: The information in this document is obsolete and should not be used for new development.
Unique1ID
You can use theUnique1IDfunction 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
TheUnique1IDfunction 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, theUnique1IDfunction 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, callUnique1IDagain, and continue doing so until you get a resource ID greater than 127.In System 7 and later versions,
Unique1IDwon't return a resource ID of less than 128.SEE ALSO
To check for errors, call theResErrorfunction 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.