version 2003
PA_CountResources (resfile; kind) long
Parameter | Type | Description | |
resfile | short | File reference number of the file to access | |
kind | unsigned long | Kind (4 Bytes type) of resource | |
Function result | long | Number of resources of type kind |
Description
The routine PA_CountResources returns Number of resources of type kind in the file referenced by resFile.
This is usually used before a loop that gets an indexed access to resources of a particular kind.
If resFile is not a valid file reference number, the routine returns 0.
Example
Do something with all the ressources of the file.
long countKinds, countRes, i, j; unsigned long kind; countKinds = PA_CountResourceKinds(resFile); for(i = 1; i <= countKinds; i++) { kind = PA_GetIndexedResourceKind(resFile, i); countRes = PA_CountResources(resFile, kind); for(j = 1; j <= countRes; j++) { /* PA_GetINdexedResource(...) */ } }
See Also
Error Handling
Use PA_GetLastError to see if an error occurred