TECH TIP: Accessing Pass-Through Functions in Delphi Design-Time
Question: “How do I make my pass-through functions available at design-time?”
Since pass-through functions are registered with RAP by calling raRegisterFunction (typically in the Initialization
section of a unit), to make your functions available at design-time we simply need to arrange to have the
initialization section of your unit executed at design-time.
To do so, we’ll create a design-time package and add in your units.
Do the following:
- Select New… from the File menu in Delphi.
- In the New Items dialog, select Package and click OK.
- In the Package editor, click the Options button.
- In the Description tab:
a: Type in a meaningful Description, such as “My RAP Functions”
b: Set usage options to Designtime only.
- Click OK.
- Right-click the Contains node and select Add.
- In the Add dialog, enter the unit or units that contain the functions you wish to make available.
- Click OK.
- Save your package with a meaningful name and click the Install button.
Your functions should now be available within RAP at Delphi design-time.
For an example of this, see the CodeSite support package in RBuilder\Demos\0. RAP\2. CodeSite.