General Component
Fnd_Gen_ComponentAvailable
Fnd_Gen_ComponentAvailable (component name) -> Boolean
Parameters
| Parameter | Type | Description |
|---|---|---|
| component name | Text | Name of the component |
| Function result | Boolean | True if the component is available |
Description
Use the Fnd_Gen_ComponentAvailable routine to determine if a specific Foundation component is available. If it is, you can then call the component using 4D’s EXECUTE command. This allows your method to behave differently if a component is available, yet still compile without the component installed. You can also make your own routines compatible with this routine by creating an initialization routine that ends with “_Init.” For example, if you create a component named “MyComponent,” just create a routine named “MyComponent_Info.” It does not matter what it does — it is only important that it does not cause an error, or at least resets 4D’s Error variable to 0. You can then test for the component this way: If(Fnd_Gen_ComponentAvailable ("MyComponent")) EXECUTE("MyComponentMethod") End if
See the source code to Foundation’s Fnd_Gen_MenuBar method to see how this function can be used.
Extracted source text
Fnd_Gen_ComponentAvailable (component name) ➔ Boolean
Parameter Type Description
component name Text Name of the component
Function result Boolean True if the component is available
Use the Fnd_Gen_ComponentAvailable routine to determine if a specific Foundation component
is available. If it is, you can then call the component using 4D’s EXECUTE command. This allows
your method to behave differently if a component is available, yet still compile without the component
installed.
You can also make your own routines compatible with this routine by creating an initialization routine
that ends with “_Init.” For example, if you create a component named “MyComponent,” just create a
routine named “MyComponent_Info.” It does not matter what it does — it is only important that it does
not cause an error, or at least resets 4D’s Error variable to 0. You can then test for the component this
way:
If(Fnd_Gen_ComponentAvailable ("MyComponent"))
EXECUTE("MyComponentMethod")
End if
See the source code to Foundation’s Fnd_Gen_MenuBar method to see how this function can be used.