A NEW TODAY IS DAWNING!

TB0008 - Using the Template Feature

Number: TB0008

Availability: As of BuildPro 8.00, developer users.


Introduction

When creating a new screen or logic (function or process) it is possible to select from a "template" screen or logic to use as a starting point. Investing time in creating a separate template application and developing various template objects can significantly increase your productivity as a developer.

When selecting the File / New pulldown menu option in either the Screen or Logic Editor, a dialog will appear allowing you to select a template on which to base your new screen/logic.
 

Creating a Template application.

The template application can be any application in the application repository. After creating or electing an existing application as your template application, point the TemplateApplication setting in your configuration file to this application. By default it is set to "global". Example from wintoday.ini:

; Template Application
;TemplateApplication=global
TemplateApplication=template

Now open your template application in the development environment and create common screen or logic objects. You'll need at least one screen, process and function in your new template application. Create as many templates objects as you want. Example of template objects are:

  • Typical screen layouts. Create a standard screen layout that include basic features such as OK / Cancel button, default colors, sizing, graphics, containers etc. This will allow you to spend more time on the templates and less time on every instance of creating a new screen.
     
  • Typical functions. Many functions have similar content with only minor changes. Create functions that you can use as a starting point when validating a key field, retrieving multiple records from a table, clearing a lookup table or other common but non generic tasks.

     

Using the display filter.

By default the template dialog will automatically display all the template objects (screens, function or processes) that match your display filter. If you want to look at only specific objects set the filter relevant value (for example "popup*" if you have many screens with names beginning with "popup").

The default filter can be set in the configuration file.

What if I do not want to create a separate template application?

The template feature works well even if you do not want to have a separate template application. Just set your default TemplateApplication to any existing application (even the current application you are working on) to make it easy to "copy" objects from that application.

If you just want to create a blank object, select File / New and press <Enter>.