User Tools

Site Tools


tplprocsource.htm
Navigation:  Application Generator > Procedure Properties >====== Procedure Properties–Source ====== Previous pageReturn to chapter overviewNext page

The Source Procedure template provides an elegant and simple way to add hand code to your application. By default, it provides simple source points at which to embed your code: the data section, code section, local procedures and routines.

The template simply declares the procedure, handles any optional parameters, places the embedded data declarations in the data section, begins the CODE section, then places any embedded executable code in the CODE section:

Procedure Name The Procedure Name is displayed here. Press the ellipsis button to change the name if desired. You will be prompted for a New Procedure Name, and the ability to Accept or Discard your changes.
Template The base template type used by this procedure is displayed here. You can change the template type by pressing the ellipsis button to the right. The Select Procedure Type dialog is displayed for a new selection if needed.
Description A short text description for the procedure, which appears next to the procedure name in the Application Tree dialog.Press the ellipsis ( … ) button to edit a longer (up to 1000 characters) description.
Category A category is used to help you group procedures together when the Category Tree Mode is active.
Module Name The source code file to hold the code for the procedure. Select from the dropdown list. By default, the Application Generator names modules by taking the first five characters of the .APP file name, then adding a three digit number for each module.
Prototype Allows you to optionally type a custom procedure prototype which the Application Generator places in the MAP section.
Parameters Allows you to optionally enter any parameter names (a list of variables separated by a comma)
Declare Globally Check this box to generate the procedure's prototype into the PROGRAM's MAP, rather than the MODULE's MAP. This makes the procedure callable from any other procedure, but it also forces a recompile of all program modules whenever you change the prototype.
Export Procedure Declares the procedure in the export file, enabling it to be called by another application. Note: This checkbox is only available when the target file specified in Application Properties is a Dynamic Link Library (.DLL).
Actions If any control templates were pre-defined in the current procedure template, or were in a window or report by you, this button accesses the Actions dialog for the control templates.Control templates provide “off the rack” controls, such as list boxes, and the code to maintain them. This allows you to start with a “bare” procedure template, such as the generic window, and add controls to create your own browse or form windows.
Window Calls the Window Designer, to visually design the window. Press the ellipsis button to access the Window Editor.
Report Calls the Report Designer, to visually design the window. Press the ellipsis button to access the Report Editor.
In the Actions dialog:
Parameters Lets you specify parameter names (an optional list of variables separated by commas, with the entire list surrounded by parentheses) for your procedure, which you can pass to it from a calling procedure. You must specify the functionality for the parameters in embedded source code. See Also: PROCEDURE Calls .
Generate Open/Close Files Routines Check this box to generate an OpenFiles and a CloseFiles ROUTINE for access in your source procedure. Files that you add in the Other Tables entry point in the Data / Tables Pad dialog will be automatically processed in these ROUTINES. You will still have to explicitly reference these ROUTINES in your hand code (i.e., DO OpenFiles, DO CloseFiles)
Generate Save/Restore Files Routines Check this box to generate a SaveFiles and a RestoreFiles ROUTINE for access in your source procedure. Files that you add in the Other Tables entry point in the Data / Tables Pad dialog will be automatically processed in these ROUTINES. You will still have to explicitly reference these ROUTINES in your hand code (i.e., DO SaveFiles, DO RestoreFiles). The SaveFiles saves a file's position, as well as any active HOLD or WATCH. It also saves a copy of the managed file's record buffer contents.

Procedure Properties Tabs

tplprocsource.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1