PA_CountResources

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_CountResources (resfile; kind) long

ParameterTypeDescription
resfileshortFile reference number of the file to access
kindunsigned longKind (4 Bytes type) of resource
Function resultlongNumber 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

PA_CountResourceKinds.

Error Handling

Use PA_GetLastError to see if an error occurred


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next