KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Checking for the presence of a plug-in
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: February 2, 2001

When using plug-ins, you may want to check for the presence of a specific plug-in at the startup of the database. This information can be retrieved by reading the BNX resources using 4D commands. The following code allows you to perform that task:

C_TEXT($1;$2)
C_BOOLEAN($0)
ARRAY LONGINT($T_Plugin_Ref;0)
ARRAY TEXT($Plugin_Name;0)
RESOURCE LIST?("4BNX";$T_Plugin_Ref;$Plugin_Name)
$0:=(Find in array($Plugin_Name;$1)#-1)
If (Count parameters=2)
If ($0)
ALERT("The plug-in"+$1+"is correctly installed")
Else
ALERT("The plug-in"+$1+"is not correctly installed")
End if
End if

You just need to put this code in a method and make the following call: MyMethod(PlugInName;*)