PA_FindPackage

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

version 2003


PA_FindPackage (pluginID) short

ParameterTypeDescription
pluginIDshortID of the plug-in
Function resultshortPackage number in the plugin list.
0 if there is no plug-in with that ID.

Description

The routine PA_FindPackage returns the 4D internal number for the plug-in ID pluginID. If no plug-in has this ID, PA_FindPackage returns 0.

At startup, 4D launches every plug-in found in the 4DX folders (4D folder and the structure folder) and stores them in an array. The number returned is the position of the wanted plug-in in the array. This number will be useful in obtaining more plug-in information using the PA_PackageInfo function.

WARNING

Several packages can have the same ID. The returned number is the number of the "first" one found by 4th Dimension.

Basically, this function is useful in checking if a 4D plug-in is present or not. DO NOT call this function during plug-in init event because the plug-in to check may be loaded after your plug-in, and in this case you will not see it. Call this function when needed in a function call.

Example

This routine checks if 4D Write (using ID 12000) is installed or not.


   if ( 0 == PA_FindPackage( 12000 ) )
   {
      PA_Alert( "This plug-in needs 4D Write" );
      gPluginCanRun = false;
   }

See Also

PA_PackageInfo.

Error Handling

PA_GetLastError always returns eER_NoErr


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