Template Guide
Template Guide
Template Guide
SoftVelocity Inc
www.softvelocity.com
Trademark Acknowledgements:
ii
Table Of Contents
Table Of Contents
Template Guide 1
General Topics ...............................................................................................................................................1
Request and Response ...........................................................................................................................1
Refresh Window routine ..........................................................................................................................2
Application Template......................................................................................................................................3
Select Application Template ....................................................................................................................3
Select Module Template ..........................................................................................................................3
Extension Templates 4
Select Extension Template ............................................................................................................................4
Additional Sort Fields Dialog ..........................................................................................................................5
Add ADO File Extension ................................................................................................................................7
ADO Login Extension Template .....................................................................................................................7
ADO Support Template - Global Extension ...................................................................................................9
ADO Process Extension .............................................................................................................................. 13
Data Columns/Hot Fields ...................................................................................................................... 15
Default SQL .......................................................................................................................................... 16
SQL Tab Prompts ................................................................................................................................. 18
BLOBInControl Extension Template ........................................................................................................... 20
CleanCloseDown Global Extension ............................................................................................................ 21
Date Time Display extension template ....................................................................................................... 22
DbAuditing ................................................................................................................................................... 23
ExtendProgressWindow .............................................................................................................................. 24
FormVcrControls extension template .......................................................................................................... 25
FileUserTags ............................................................................................................................................... 25
FrameExtension Template .......................................................................................................................... 26
Global Cooperative Threading Extension ................................................................................................... 28
MDI Synchronization - Global Extension .................................................................................................... 29
MDI Synchronization - Procedure Extension .............................................................................................. 30
Preemptive Procedure Extension ............................................................................................................... 30
Process Transaction Frame extension template......................................................................................... 31
Record Validation extension template ........................................................................................................ 32
ReportChildFiles .......................................................................................................................................... 33
RunCommandLineProc ............................................................................................................................... 34
Save Button Transaction Frame extension template .................................................................................. 34
Set DLL Image Base Memory Address ....................................................................................................... 35
Version Resource extension template ........................................................................................................ 36
WindowResize extension template ............................................................................................................. 39
Wise-Generate Wise Installation Script ...................................................................................................... 44
Business Rules Manager - Global Extension Settings ............................................................................... 45
Global Rules ......................................................................................................................................... 47
Rules - Controls .................................................................................................................................... 49
Local Business Rules Manager .................................................................................................................. 50
Local Business Rules ........................................................................................................................... 52
Local Business Rules - Hot Fields ........................................................................................................ 52
Local Business Rules - Locally Defined ............................................................................................... 53
Local Business Rules - Special Controls .............................................................................................. 54
Local Business Rules - Used Controls ................................................................................................. 54
Local Business Rules - Used Global Rules .......................................................................................... 55
Code Templates 56
Select Embed Type ..................................................................................................................................... 56
ADO Browse Refresh Code Template ........................................................................................................ 58
ADO Browse to XML Code Template ......................................................................................................... 58
iii
Template Guide
CallABCMethod ........................................................................................................................................... 58
Call a Procedure (Extended) code template ............................................................................................... 59
Call Procedure As Lookup code template ................................................................................................... 60
Close Current Window code template ........................................................................................................ 60
Control Value Validation code template ...................................................................................................... 60
DisplayPopupMenu ..................................................................................................................................... 61
Export to XML code template ...................................................................................................................... 62
FromXML code template ............................................................................................................................. 63
GetFullDragSetting code template .............................................................................................................. 64
GetOSVersion code template ..................................................................................................................... 64
Import From XML code template ................................................................................................................ 65
InitiateThread code template....................................................................................................................... 66
Lookup Non-Related Record code template ............................................................................................... 67
Process Transaction Frame Checkpoint code template ............................................................................. 67
ResizeSetStrategy ...................................................................................................................................... 68
SelectToolbarTarget code template ............................................................................................................ 69
SetABCProperty .......................................................................................................................................... 69
SetFullDragSetting code template .............................................................................................................. 70
SetProperty code template.......................................................................................................................... 70
ToXML code template ................................................................................................................................. 71
ViewXML code template ............................................................................................................................. 72
Control Templates 73
Select Control Template.............................................................................................................................. 73
ADO Browse Box Control Template ........................................................................................................... 76
ADO Browse Box Select Button .................................................................................................................. 84
ADO Browse Process Button ...................................................................................................................... 84
ADO Browse Update Button control template ............................................................................................. 85
ADO Errors Object List Control Template ................................................................................................... 86
ADO Process Pause Button ........................................................................................................................ 86
ADO Save Button Control Template ........................................................................................................... 87
ADOLoginControls Control Template ......................................................................................................... 89
ASCII Print Button control template ............................................................................................................ 89
ASCII Search Button control template ........................................................................................................ 89
ASCII View control template ....................................................................................................................... 90
ASCII View in List box ................................................................................................................................. 91
Browse Box control template ...................................................................................................................... 92
BrowseFuzzyMatching control template ................................................................................................... 103
BrowseGrid................................................................................................................................................ 105
BrowsePrintButton .................................................................................................................................... 106
BrowsePublishButton (BrowseToHTML) .................................................................................................. 107
BrowseNoRecords Button control template .............................................................................................. 108
BrowseQBEList Control Template ............................................................................................................ 109
Browse Select button control template ..................................................................................................... 112
BrowseToolboxButton ............................................................................................................................... 112
BrowseToolbarControl .............................................................................................................................. 112
BrowseUpdateButtons control template .................................................................................................... 113
BrowseViewButton .................................................................................................................................... 116
Calendar Button Control Template ........................................................................................................... 116
Calendar Button - General Tab .......................................................................................................... 117
Calendar Button - Classes Tab .......................................................................................................... 118
Cancel Button control template ................................................................................................................. 120
Close Button control template ................................................................................................................... 120
DOS File Lookup control template ............................................................................................................ 121
DynamicImage .......................................................................................................................................... 123
Field Lookup Button control template ....................................................................................................... 123
File Drop control template ......................................................................................................................... 124
iv
Table Of Contents
v
Template Guide
vii
Template Guide
viii
Template Guide
General Topics
Request and Response
One of the biggest considerations of template design is inter-procedure communication. The added dimension of multi-
threading only serves to make this more complex.
In a generic template-driven system, it is impossible to require that parameters be supported in templates. It's never
certain if a Browse will be calling a Form, or if it calls a Report, etc. In fact, with Control Templates, a form can also be a
browse, and an ASCII viewer. To require users to know all of the different parameters and their values is unreasonable.
Further, building in support for functions would overcomplicate the templates to the point of unusability. Again, add in the
complications of multithreading and the system is unusable and difficult to maintain.
Using global variables is acceptable, with the THREAD attribute ensuring that the variable itself is safe within a thread.
Unfortunately, the value of any global variable must be called into question as soon as any EMBED point is encountered,
as the value could change with another procedure call, etc.
Any communications variable must therefore have as little happen from the time it is assigned a value and the time that
value is interpreted. This time is referred to as the Span of the variable. The shorter span, the better the integrity of the
system. The communications variable should also be considered suspect as soon as possible. The amount of time that
the variable is considered to have a valid value is referred to as Live Time. If a variable has a short Live Time, its less
likely to be subject to misinterpretation, and again system integrity benefits.
To this end, we've implemented a Request and Response system in the Clarion templates. This system was created to
maintain the integrity of interprocedure communications in a fully generated system. In other words, if no embedded
source is used and no hand-coded modules are used, confidence in system integrity is high.
There are three components to the Request and Response system:
If you are creating an application that consists of more than one AppGen created DLL, you MUST check the "Generate
Internal Global Data as EXTERNAL" check box for all DLLs except one. Likewise, you MUST check the "Generate
Internal Global Data as EXTERNAL" check box for each APP creating an .EXE.
1
Template Guide
Enumerated These are primarily to increase readability of the code. The actual
EQUATEs: numbers themselves are inconsequential, with one exception; Request
values less than 0 are reserved for use in multi-page systems.
2
Template Guide
Application Template
Select Application Template
Located in the Application Properties dialog
If you've added third party or your own templates to the template registry, and they include Application templates, this lets
you choose which template set controls source code generation.
CLICK on an item from the list, then press the Select button.
GENERATED Source Use this choice when the module to add is source code which is
generated by the Application Generator. This allows you to
control the name of the Module.
External DLL External Dynamic Link Module--Use this choice when the module
to add is a DLL.
External Lib External Library Module--Use this choice when the module to
add is a .LIB (without a .DLL).
External OBJ External Object Module--Use this choice when the module to add
is a .OBJ file.
External Source Use this choice when the module to add is Source Code that will
not be maintained by the Application Generator. The Application
Generator reads and compiles this source file but does not write
to it.
3
Template Guide
Extension Templates
Select Extension Template
Extension templates add functionality to procedures, but are not bound to a particular control or embed point. Each
Extension template has one well-defined task. For example, the Date Time Display lets you display the date and a running
clock. If you add third party, or your own customized templates to the Template Registry, they appear in the list.
From a Procedure Properties dialog, add an Extension template by pressing the Extensions button. CLICK on an
extension template from the list, then press the Select button. Here are some of the Extension templates that Clarion
provides:
ASCII View in List Box This extension provides a LIST control to alternate its display
between a selected file and some other data that you specify.
cwRTFGlobal This global extension enables the use of an RTF control in the
application. It includes all necessary EQUATEs and Classes.
Deprecated and replaced with the RTF Text Control template.
Date Time Display This extension adds a "live" date and/or time (updated every
second) display to the procedure
FileUserTags This global template extension identifies certain tables and columns
that possess a particular User Options tag defined in the dictionary.
WindowResize This Extension template lets the end user resize windows that have
traditionally been fixed in size due to the controls they contain (List
boxes, entry controls, buttons, etc.).
4
Template Guide
This dialog is supported in both ABC and Clarion template chains. The sort sequence selected applies to the appropriate
ABC method or ORDER property required.
Sort Type
Manual
Press the "E" button to call the Expression Editor. This dialog is used to help you construct syntactically correct
expressions to use in the Additional Sort Fields prompt. This allows you to manually construct a sort string using the
following syntax:
"+FieldLabelOne,-FieldLabelTwo,…"
An incorrect string will result in no sorting, and may generate a compile error.
Assisted
The Assisted method is designed to build a correct sort string. Use the update buttons provided to add your sort fields to
the list. In the additional dialog, provide the following information:
Field
Use the ellipsis to select a field name from the Select Column dialog.
Order
Select Ascending or Descending from the drop list, to designate an ascending or descending sort order.
ConditionalAssisted
Valid for Report and Process only. The Conditional Assisted sort type adds a condition to the assisted method, where the
additional sort fields will only be applied when the condition is true.
Condition
Use the ellipsis to select a field name from the Select Column dialog. When this field or column is non-zero, the additional
sort fields will be applied.
5
Template Guide
Field
Use the ellipsis to select a field name from the Select Column dialog.
Order
Select Ascending or Descending from the drop list, to designate an ascending or descending sort order.
DynamicSorting
Valid for Report and Process only. This Sort Type generates a dynamic sort window at runtime, where your users can
modify (prior to generating the report) the sort components as to the report’s order and component sort type (ascending or
descending). Use the update buttons to add the fields that you wish to present to the user here. This sort type is useful
when your sort components are fixed, but the user needs to switch the order and sequence occasionally.
Description
Enter a description to use for the field name.
Field
Use the ellipsis to select a field name from the Select Column dialog.
Order
Select Ascending or Descending from the drop list, to designate an ascending or descending sort order.
Sorting Window
The components of the sorting window generated at run time can be modified here. In addition to the Title text and Status
Bar Message, buttons can also be customized with a variety of options. Click here for additional help.
DynamicNamed
Valid for Report and Process only. This sort type is similar to DynamicSorting above, but is expanded here to allow groups
of sort fields to be referenced by a single name. This is powerful with a generic report designed with no default key. Enter
different Names, each one with different sort criteria. A single report can now be used for "on the fly" sorting based on the
sort groups that you provide.
Name
Enter a group name to use to identify the sort sequence that you design.
Field
Use the ellipsis to select a field name from the Select Column dialog.
Order
Select Ascending or Descending from the drop list, to designate an ascending or descending sort order.
Sorting Window
The components of the sorting window generated at run time can be modified here. In addition to the Title text and Status
Bar Message, buttons can also be customized with a variety of options. Click here for additional help.
6
Template Guide
The ADO File Extension allows you to include additional ADO file declarations that you have declared within your data
dictionary.
Including this extension in any procedure creates a "To Do" in the Data / Tables Pad named "Other ADO File". This
interface allows you to include and reference any element of the ADO table without forcing the templates to generate a
connection.
1. Select UserID, Password, and Server prompt at runtime if the user will be required to login each time the
application is loaded (the ADO Login procedure is always the first procedure called by default).
Login details
Number of retries allowed
Enter a number here to set the number of user login attempts.
7
Template Guide
2. If you select UDL File as the connection string source, a user login is not required. The application attempts to
read from the UDL file name you specify.
Check the Data Link Dialog can be displayed to the user check box to allow a connection dialog to be displayed
when attempting to connect to the data source. If left unchecked, the data connection process is silent (no indication
of connection attempt is shown to the user). You should only leave this check box unchecked if you are sure that your
ADO connection is from a reliable source.
8
Template Guide
What is ADO?
This release of Clarion introduces template support for ADO (Active Data Objects). Your browses and forms can operate
with ADO like they would with conventional databases. The big difference is that ADO uses OLE DB/ODBC as the
connection means, instead of the native drivers. The ADO templates are designed to provide a similar design interface, as
you are already familiar with using conventional database interfaces.
The ADO Global Extension is required for any application that will use ADO. In addition, you can set up Global
Connections to ADO that can be used by any ADO-based procedure.
Connections
The ADO Support Global Extension is used to add ADO connections to use throughout your application. Press the
appropriate update buttons to add (Insert), modify (Properties), or remove (Delete) an ADO connection.
Connection Object
Enter a name (string) that you wish to use to reference your connection. You can override the default name that is
provided by the template.
Connection Class
The Connection Class references the default library used to connect to the ADO service. If you wish to use an alternate
third-party class, or a class that you have written, select it from the drop list provided. Otherwise, accept the default class
(Cconnection)
Cursor Location
A cursor is a database element that controls record navigation, update ability of data, and the visibility of changes made to
the database by other users.
Cursors are set and based on the type of data you anticipate working with, and where the processing will take place.
Don’t set
This tells the ADO connection to use the default cursor method of the particular data source. Unless your site has
specific requirements that need to override this, leave this setting as is.
AdUseClient
9
Template Guide
This value indicates that a client-side cursor supplied by a local cursor library is to be used.
AdUseServer
This value indicates that the data provider or driver-supplied cursor is used.
AdUseClientbatch
For backward compatibility, this value indicates that a client-side cursor supplied by a local cursor library is to be
used.
Note that the cursor settings drop list choices are all prefaced with "ad;" these are simply the ADO constant names. The
descriptions of each cursor type are provided as "basic" information about the cursor. Please refer to the documentation
provided by your OLE DB Provider vendor and/or DBMS for specific information about your site.
Every ADO application requires a connection string. Select from one of 5 sources to build your connection string from:
From Dictionary
Your data dictionary stores ADO connection string information for each file that you imported using the ADO file driver.
Press the ellipsis button to choose a Dictionary Table. The connection string will be displayed in the text box provided.
You also have the option to save the string read from the Dictionary into a Universal Data Link (.udl) file. Press the
Save Connection String in UDL file button to write the string contents to an external UDL file.
The first two lines of any universal data link (.udl) file must have exactly this content:
[oledb]
; Everything after this line is an OLE DB initstring
After these required lines, the remainder of the .udl file consists of a connection string written in the same format used
when opening a database from programming code.
Press the ellipsis button to load an existing UDL filename’s connection string into the connection builder text window.
After your changes are made, you can save the changes to a new UDL file name by pressing the Save Connection
String in UDL file button.
It is not required to load an existing UDL file. You can create a custom connection string from scratch, or paste it from
an alternative source.
Connection Builder
Select this source option to manually build your connection string using the Conncection Builder. There is an option to
save this string to an external UDL file.
Connection String
Press the Connection Builder button to create an ADO connection to a designated data source. The contents
(output) of the Connection Builder will be displayed in the Connection String text box. You also have the option of
entering a custom (manual) connection string here.
Oracle Support
If you are establishing a connection to an Oracle database through the ADO support, check the Use Oracle Syntax box.
This setting is also used to conditionally omit the setting of the ADO RESYNC command in order to refresh the browse
after an update.
To activate special processing for Oracle dates during form updates, additional prompts are provided:
TO_DATE format
11
Template Guide
Oracle uses a special server function called TO_DATE to process date and time information through the ADO
layer. Enter a string constant here that reflects the way that data and time information will be translated through
the ADO layer.
Associated CW Date
Enter a valid date picture here, or press the ellipsis to build a picture in the Picture Editor dialog.
Associated CW Time
Enter a valid time picture here, or press the ellipsis to build a picture in the Picture Editor dialog.
The picture tokens that you select in the CW Date and Time fields MUST MATCH the format string in the
TO_DATE format entry. For example, for the following string:
YYYY-MM-DD HH24:MI:SS
Use a @D10- token to match the date portion, and @T4 to mtch the time string. If you change any part of the
TO_DATE format, you will need to modify the appropriate CW date or time picture token.
Classes
The Classes tab contains an extensive list of default classes used with the ADO templates. Unless you specifically create
a new class definition, or, obtain one from a third-party vendor, you should accept the default class settings.
12
Template Guide
The ADO Process Extension Template is the core template for all Process and Report procedures that use ADO as a
connection layer.
General Tab
Process Prompts
Processed Text
Enter a string of up to 100 characters that will be displayed on the process progress window. If left blank, the default is
"Processed"
Timer Value
Enter a numeric value to specify the time slicing interval between the time that rows are being processed, and the update
frequency of the progress window. Values are in hundredths of a second. If left blank, the default value is 50 (half
second).
Rows to fetch per timer
Enter a number to designate how many rows can be processed in each timer interval. This number should be decreased if
the complexity of the process is increased. The default value is 10.
Close Window
Check this box to automatically close the progress window when the ADO process has completed.
Enable Report
Check this box to call a report after the process is completed. This check box will in effect enable the procedure’s Report
button and the subsequent Report Formatter.
Print Preview
Check this box to call a Print Preview window prior to printing the report.
13
Template Guide
X Position The initial horizontal position of the left edge of the window.
Y Position The initial vertical position of the top edge of the window.
Data
The Data tab control contains prompts that focus on the ADO connection information:
Connection Group:
Connection Object
Choose a Connection object name from the drop list provided. This list should contain the connection object you
created in the ADO Global support template.
Use a New Connection
If you do not wish to use any of the Global Connections that are available, check this box to create a new
connection specifically for this browse box.
New Connection
Press this button to call the Connection Builder. On the subsequent dialog, enter a new name to use for the new
Connection Object, and press the Connection String Settings button to access the Connection String Settings
dialog.
Command Object
The ADO connection layer contains a default command object that is responsible for handling the appropriate data update
behavior. If you need to select an alternative object name, enter the value here.
14
Template Guide
The Data Columns and Hot Fields tab control provide prompts that allow control of the data elements that will appear in
the Process or Report procedure.
Hot Fields
The Hot Fields list box displays data elements that may not be populated in the report structure, but need to be referenced
or updated in the procedure source. Hot fields are normally data elements that are related to the contents of the primary
data elements (i.e., Address information, text based descriptions, etc.). Press the Properties button to access the
following prompts:
Hot Field
Press the ellipsis button to select a field to use as the hot field.
Column is a
Identifies the data element as one that is read directly from the ADO data source (Table Column), or one that is a
variable defined within the application, like a computed or conditional field (Expression).
Use AS
Check this box if the column name is long and verbose, and you need to rename the column to a more descriptive
and compacted name. This is useful if you are constructing long or complex SQL statements. This is an option for
Table Columns, but required for all Expressions.
Expression
Enter a valid expression to use for the defined Data Column
Data Columns
The Data Columns list box displays data elements that have been populated in the Report Formatter. Press the
Properties button to access the following prompts:
Query Field
Identifies a column as a field that can be queried (searched).
15
Template Guide
Column is a
Identifies the data element as one that is read directly from the ADO data source (Table Column), or one that is a
variable defined within the application, like a computed or conditional field (Expression).
Use AS
Check this box if the column name is long and verbose, and you need to rename the column to a more descriptive
and compacted name. This is useful if you are constructing long or complex SQL statements. This is an option for
Table Columns, but required for all Expressions.
Expression
Enter a valid expression to use for the defined Data Column
Default SQL
Because the SQL to access the data is vitally important, the ADO templates allow you to view the generated SELECT
statement and customize it if necessary. This also provides a convenient way to customize the process or report ordering,
should you wish.
Regenerate SQL
Press this button to reset the original template-constructed SQL statements. This is useful should you need to start from
scratch again before customizing your statements. Only enabled when the next prompt is active (checked).
Override SELECT SQL
Check this box to bypass the auto generation of the SELECT statement by the templates. Your custom statement will be
substituted in its place. This box also enables the Regenerate SQL button, should you wish to reset the statement back to
its original value.
Default SQL Select
This text box provides the base SELECT statement. Note that if your process or report contains fields from more than a
single table, it will automatically provide for a JOIN.
Important Note: If you've populated a field in the Data Columns tab for which the ADO templates can't resolve the proper
syntax and the resulting page doesn't print properly, examine the SQL statement here. Should you find a statement with a
blank for the field name (look for an extra comma in the order that the suspect field appears in the data columns list, as in
Select fieldname,fieldname,,fieldname...), you may edit the statement here or delete the suspect column from the list.
Unique Key
As stated on the tab control, ADO/SQL requires a unique key to identify a record. Should you have more than one unique
key defined in your table, press the ellipsis button to select an alternate key to use.
Default Behavior
16
Template Guide
The default behavior of the ADO Process control has a much different interface than the standard report or process. You
will also notice that the filter capabilities are expanded in the ADO template. The following prompts are available:
Fields Tab:
The Fields tab control provides control of your process or report’s filtering and sorting features.
Column
Select a column name from the drop list provided to use as criteria for the Process/report’s filter or range. The
columns displayed are those columns you have defined in the Data Columns/Hot Fields dialog.
Single Value
Lets you limit the filter criteria to a single value. Specify the variable containing that value in the Range Limit
Value box which appears.
Range of Values
Lets you specify upper and lower limits. Specify the variables containing the limits in the Low Limit Value and
High Limit Value boxes.
Less Than
Lets you limit the records read to all records less than a single value. Specify the variable containing that value
in the Range Limit Value box which appears.
Great Than
Lets you limit the records read to all records greater than a single value. Specify the variable containing that
value in the Range Limit Value box which appears.
IN
17
Template Guide
Lets you limit the records read to all records that match the contents of a single value.
Begins with
Lets you limit the records read to all records that begin with the contents of a single value.
Ends with
Lets you limit the records read to all records that end with the contents of a single value.
Contains
Lets you limit the records read to all records that begin with the contents of a single value.
Sort Columns
Press the update buttons to add (Insert), modify (Properties), or remove (Delete) the process controls default sort
elements. These are the data elements used to alternately sort the records processed by the control. The SQL tab control
generates the ORDER BY clause.
Column
Select a column name from the drop list provided to use as criteria for the browse filter or range. The columns
displayed are those columns you have defined in the Data Columns/Hot Fields dialog.
Direction
Choose ASC from the drop list to designate an ascending sort, or DESC to specify a descending sort.
Essentially, the settings of the Range or Filter are used to generate the SQL WHERE clause, and the Sort Columns
setting are used to generate the ORDER BY clause.
18
Template Guide
Conditional Behavior
The Conditional Behavior tab duplicates the prompts and resultant functions found on the Default Behavior tab, with the
addition of a Condition prompt:
Condition
Enter any valid Clarion expression.
Classes
Use the Classes tab to override the global settings for the Class. See Classes Tab.
19
Template Guide
The BLOBInControlExt extension template allows you to display and/or edit a BLOB from a selected table.
Normally, BLOB processing involves populating a local or global variable that will load the BLOB contents from a selected
table. As the BLOB is updated, the contents of the control is transferred back to the BLOB and stored in the table. This
template is designed to handle all of the processing that is necessary to do this.
The use of this template is valid in Browse, Form, or Report procedures to retrieve (read) a BLOB’s contents and assign it
to a control. In addition, you can also save (write) the BLOB’s contents in the Form procedure.
A list box is provided to allow you to enter multiple BLOB controls. On the BLOB Fields Properties window, the following
template prompts are provided:
BLOB Field
Select from the drop list the target BLOB field defined in the table that will be displayed and potentially updated (if used on
a Form).
Control
Select the Field Equate Label, from the drop list, of the control that will be used to display and/or update the BLOB
contents. This control must be either a text or image control, depending on whether the type of information contained in
the BLOB column is text or Binary (i.e. Image) data.
If this is a text control, the use variable for the control must be a string type variable and it must be large enough to hold
the largest potential Blob data in the associated Table that you plan to update.
When Image does not exist use the following image – Image File:
If the control is an image control, enter the name of a valid image file (or press the ellipsis button to select one) that will
display if an image does not exist in the target BLOB control.
Resize to control size
Check this box if you would like the BLOB’s contents to resize to fit the image control. If not checked, the default size as
stored in the BLOB is used. Using the default could cause the image to display cropped if the image control is too small.
Condition to assign from control to BLOB
Enter an expression in the Condition field which will force the BLOB to be updated from the target control only when the
expression evaluates to TRUE. Press the ellipsis button to select a variable to use in the expression.
By default, this setting is TRUE, which means that the BLOB field will always be updated when the Form is Accepted,
even if the BLOB contents did not change. To improve program performance and network traffic, enter a condition that will
cause the BLOB to be updated only when necessary.
For example:
?Text{PROP:Touched}=True !was the text field modified?
or
CLIP(LOC:ImageFileName)<>'' !was an image loaded into BLOB?
20
Template Guide
CleanCloseDown PROCEDURE()
CODE
MESSAGE('BYE')
GLO:CleanCloseDown = True
NOTIFY(NOTIFY:CloseDown,GLO:CleanCloseDownMainThread)
When using this template in your application, the following global variables are internally defined:
GLO:CleanCloseDown BYTE(0)
GLO:CleanCloseDownMainThread LONG
The only template prompt available is the ability to Disable Clean Close Down when testing its compatibility with other
third-party templates.
In multi-DLL applications, you will also need to include the global extension in any DLL target application that will need to
use the CleanCloseDown procedure.
21
Template Guide
Display in Window
Check the box or boxes to add the date or time display to your window.
Date/Time Picture
Choose a date and/or time display picture from the drop down list. The list displays examples, such as "October 31,
1959," and "5:30P.M."
Other Date/Time Picture
Type in a picture of your choice, if the picture type you wish does not appear in the list. See Also: Date Picture Tokens.or
Time Picture Tokens
Show the day of the week before the date
(Date only) Optionally displays the day of week.
Location of Date/Time display
Choose between displaying the date and/or time on the status bar, or in a control.
Status Bar Section
When specifying the Date or Time should appear on the status bar, specify the status bar section.
Date/Time Display Control
When specifying the Date or Time should appear in a control, choose the control from a drop down list of field equate
labels for the window.
22
Template Guide
DbAuditing
The DbAuditing template is a global extension used to track updates to specific data tables. This extension is added to the
global properties of an application.
The DbAuditing template provides the following prompts:
Log Files
This tab contains a list box that lets you define log files and options for the files used in an application. Add a new log file
definition by pressing the Insert button. This displays a dialog where you name the log file and define its contents. Use
the and to change the order of the log files.
File to Log
Choose a file from the drop list that consists of all files defined in the dictionary. Any updates to this data file are written to
its associated log file.
LogFile Name
Specifies the name of the log file to update.
Username Logging
The username logging option is used to track which user is making the update to the specific data file. It does this by
adding an extra column to the log file for the user's login name.
Username variable
Specifies the variable which contains the current user. The value of this variable gets written to the log file to indicate the
user who made the change to the data file.
Username Header
Specifies the header to be used in the log file for the user column.
Username picture
Specifies the format to be used for the user column in the log file.
File Fields to Log
This option gives the ability to customize a log file for each data file. For example, you may wish to log changes to certain
fields and allow changes to others without logging them. Press insert to select a field to write to the log file. Use the
and to change the order that the fields are logged to the log file.
Field
Specifies the field name for the data that is writen to the log file.
Field Header
Specifies the header to be used in the log file for the data column.
Field Picture
Specifies the format to be used in the log file for the data column.
Miscellaneous Fields to Log
This option gives the ability to customize a log file for miscellaneous data. Press insert to add a field to the log file. Use the
and to change the order that the miscellaneous fields are logged to the log file.
Field
Specifies the field name for the data that is writen to the log file.
Field Header
Specifies the header to be used in the log file for the data column.
Field Picture
Specifies the format to be used in the log file for the data column.
23
Template Guide
ExtendProgressWindow
The ExtendProgressWindow template adds functionality to Process and Report procedures. It is designed to do two
things:
Give you precise control over the visual feedback you provide end users for (small) Process and Report
procedures.
Allow Process and Report procedures to operate in two separate modes--all records mode and single record
mode (current value range-limit).
You can use the ExtendProgressWindow template to delay or to completely suppress the progress window for a Process
or Report procedure, and you can optionally specify a wait cursor. In single record mode, you can suppress the progress
window, the print preview, or both.
The ExtendProgressWindow template provides the following options.
Delay Showing Window
Enter the number of seconds to hide the progress window. For example, you may want to hide the progress window for 3
seconds so that processes or reports that finish within 3 seconds limit never show a progress window.
Wait cursor
Check this box to display a wait cursor (hour glass cursor) for the duration of the process or report. For small/short
processes and reports, your end users may prefer a simple wait cursor over a progress window. On completion, the
procedure restores the cursor to its previous state.
Single Shot
These options are available only for Processes and Reports that specify a key in the Data / Tables Pad.
Single record
Check this box to allow the Report or Process to operate in its normal mode (process all records), or to operate in single
record mode (current value range-limit) when GlobalRequest is set to ProcessRecord (see Procedure Templates--Inter-
Procedure Communication for more information on GlobalRequest).
If your Report or Process procedure uses a non-unique key, you can process all records with the current key value!
The BrowsePrintButton template primes the range-limit field and calls procedures in this single record mode (see Control
Templates--BrowsePrintButton).
Use Progress
Check this box to display the progress window in single record mode. Clear the box to suppress the progress window in
single record mode.
Use Preview
Check this box to provide the print preview in single record mode. Clear the box to suppress the print preview in single
record mode.
24
Template Guide
FileUserTags
This global template extension identifies certain tables and columns that possess a particular User Options tag defined in
the dictionary. The template then marks or assigns that tag, and allows the programmer to reference the tag in place of
the physical table or column name. This allows the programmer to write code using the User Options tags in the
dictionary in place of the actual names used to define them.
The FileUserTags template provides the following prompts:
Interesting File Tags
Specifies defined table tags from the dictionary to use as a reference to the table that contains the tag.
Interesting Field Tags
Specifies defined column tags from the dictionary to use as a reference to the columns that contain the tag.
25
Template Guide
FrameExtension Template
The FrameExtension extension template adds two powerful features to any Application Frame; the ability to shut down
any application when Windows shuts down , and the ability to dock your Clarion application on to the system tray.
The following options are available:
Enable ShutDown
Check this box to allow your application to close down when the Windows operating system is also shut down.
Enable Tray Icon
Check this box to allow your application to be minimized in the system tray instead of the system toolbar. By default the
icon used in the system tray is the same icon that is assigned to the application frame.
SetToTrayOnLoseFocus
This option allows an application to be minimized to the system tray when losing focus.
This option is only active if no MDI child windows are opened. This "lose focus" option is designed to be used in
applications with only one window (like the IPDRV service manager).
Tray Icon Tooltip:
Enter a valid string value to use as a tool tip. When your mouse moves over the system tray icon, the tool tip is displayed.
Press the Tray Icon Mouse Right Button Menu button to access an additional dialog that allows you to add a context
menu to the system tray icon. Right-clicking on the system tray icon activates the popup menu.
The Context Menu interface allows you to construct custom menu items to add to the popup menu used with the system
tray icon. You can select from a list of actions to attach to each menu item that you create.
Press the appropriate button to add (Insert), modify (Properties), or remove (Delete) a context menu item. The following
options are available or the subsequent dialog.
Is a separator?
Check this box if you would like to add a separator line to your context menu. There are no other prompts associated with
this action.
Menu Text
Enter the name of the context menu item to display.
When Pressed
No Special Action
The menu item will have no template-generated action associated with it. This option normally is used when you are using
an embed point to control this menu’s action.
Execute Routine
Enter a valid Routine Name here. Of course, you must have the ROUTINE defined within the scope of this procedure.
Post Event to Control
Select a valid Field Equate from the drop list to post an event to the Control. Select an Accepted or Selected Event to
post to the control from the drop list provided.
Call a Procedure
The Context Menu interface uses the standard interface for calling a procedure. If you need more detailed help here, see
the following topic.
Run a Program
The Context Menu interface also uses the standard interface for running a program. If you need more detailed help here,
see the following topic.
26
Template Guide
27
Template Guide
The options for this extension are made up of a single check box.
Enable Global Cooperative Threading
Check this box to switch your application to use a cooperative threading model in place of the preemptive model.
More information on these models (including advantages and disadvantages) can be found in the Preemptive and
Cooperative Thread Models topic.
This template automatically includes a Preemptive Procedure Extension in all procedures defined in your application. This
allows you exact and convenient control over each procedure’s thread models.
For example, if the majority of procedures will need to use the cooperative thread model, check the global option, and use
the Preemptive Procedure Extension to enable the few exceptions. On the contrary, you can turn off the Global
Cooperative Threading model, which makes all procedures preemptive by default, and enable Cooperative Threading by
turning off the individual procedure’s Preemptive Procedure Extension.
Classes
The Cooperative Threading model uses the default ThreadLocker and CooperationClass classes. If you wish to include a
different set of classes to use in place of these defaults, enter the new name in the prompts provided, or press the
appropriate ThreadLocker and CooperationClass buttons to override the default classes behavior.
28
Template Guide
The MENU on child windows is generally only a factor when the MDI windows are being opened Maximized. These are
some "worst-case" scenarios:
MDI child windows that are opened in a LOOP and are either maximized initially, or the program maximizes them directly
on the basis of information stored in a user configuration files such as an INI file or in the Windows registry.
The program does something that requires the OS to update internal MDI structures, and before that can complete
initiates another operation that also requires the same structure to be updated. For example, opening other windows, on
the event EVENT:Sized. At the point when this event is processed, the Operating System may not have completed update
of internal structures associated with the first MDI window, thus the internal OS structure becomes corrupted.
The program uses Menu’s on the MDI Child windows and the windows are opened Maximized in a loop.
29
Template Guide
This code is very likely to have problems, particularly on slower machines, and even more so on less robust OS's like
W98/ME. It is generally a bad programming practice to write code like the above, especially if your application must run on
W9x/ME OS’s. However, the results from our tests using the 6.1 RTL and the new "MDIsynchro" class/template this code
will generally succeed, --- but it is not guaranteed because so much can depend on factors outside the control of your
program; things such as Operating System, CPU speed, available memory/resources, number of other running processes
may all affect your program.
Summary
Most of the problems found can be avoided with the use of the 6.1 Runtime Libraries and the new MDI synchronization
template, however some problems may also require changes in your coding style.
30
Template Guide
You can even get a greater control on how many records get "framed" with the inclusion of the Process Transaction
Frame Checkpoint code template in the embed point of the TakeRecord method. This checkbox must be on for the frame
checkpoint to be generated.
Include Children in the transaction?
The primary table named by the process procedure will always be included in a transaction frame on any update
operation. This option allows you to specify if you want to include any children that are related to the primary table (via
the dictionary). Select Always if you want to include all child tables in all update operations. Select Never if you want to
exclude all related child tables from all database operations on the primary table.
31
Template Guide
32
Template Guide
ReportChildFiles
The ReportChildFiles template adds functionality to Process and Report procedures. This extension template provides a
simpler, more efficient, more controllable alternative to setting a chain of related files in the Data / Tables Pad and having
the Report or Process template produce a single multi-tiered VIEW.
The ReportChildFiles template lets you name only the primary file and any lookup files in your procedure's Data / Tables
Pad. The template generates code to read (and optionally print a separate DETAIL for) the related child-file records for
each primary file record. We recommend the ReportChildFiles template for the typical invoice headers/invoice lines
scenario.
Multi-tiered View
Suppose you have an invoice header file and an invoice detail file. You want to print out a header and then a line for each
detail. This is somewhat tricky to do with a single view and there are some limitations and inefficiencies with this
approach. You must populate each header (parent) file field into a group HEADER and each detail (child) field into a
DETAIL. The limitation is there are no events and no embed points to use when the parent record prints (because it is
simply a group break). The inefficiency is that additional GETs are done on parent file lookups for every child record even
though the parent record is unchanged. Plus, for SQL you must use a left outer join (inefficient) to force parent headers to
print when there are no associated detail lines.
ReportChildFiles
With the ReportChildFiles template you can simply populate the header (parent) as the primary file with its own DETAIL,
then populate a second DETAIL for the detail (child) file. The primary view is then read record-by-record (lookups done
only once for each parent record) and the child view is range-limited on the parent file linking fields. The Process Manager
Method TakeRecord embed point provides an access point for both parent and child records. ProcessClass.TakeRecord
is called for each record (parent or child), and ProcessClass.ChildRead indicates which file/record is active. See
ProcessClass for more information.
Using the ReportChildFiles Template
The ReportChildFiles template provides the following options.
Parent File
Type the label of the parent file, or press the ellipsis button (...) to select the parent file from the Select Table dialog.
Detail
For Report procedures, select the USE attribute (field equate label) of the REPORT DETAIL structure to print for each
child record.
The Detail drop-down list shows DETAIL structures with USE attributes, so populate the DETAIL first, and add a USE
attribute.
Data / Tables Pad <To Do>
Insert the child file to process for each parent file record.
Classes Tab
Use the Classes tab to override the global ViewManager setting. See Template Overview--Classes Tab Options--Global
and Local.
33
Template Guide
RunCommandLineProc
The RunCommandLineProc global template extension provides a simple way to check for command line parameters
when the program is run. Several command line parameters may be defined and sorted in the order they should be
checked at runtime.
The RunCommandLineProc template provides the following prompts:
Log All Errors Silently
Check this box to disable the ErrorManager error windows while running the procedure nominated on the command line.
Errors are written to a log (.TXT) file. This avoids the need for any user intervention.
Procedure Name Flag
Specifies a special command line parameter to check for when the program is started. A variable can be specified here if
it is preceded by an exclamation point (!).
Call generated procedure
Check this box if the presence of the command line parameter on the command line will cause a procedure generated
from the application to be called.
Procedure To Run
Specifies the procedure to be called when the command line parameter is passed to the program on the command line.
Choose a procedure from the drop down list if a generated procedure will be called. Enter the name of the procedure in
the entry column if it is am external procedure to the application.
34
Template Guide
Choose Address
This tab control allows you to select a memory address from a list of image base memory addresses to use for your target
DLL.
DLL Base Address in hex
Enter an eight digit memory base address in hexadecimal format.
Select a different base address for each DLL you use in your application.
The listed addresses are on 1 MB boundaries and should allow room for large DLLs. If your DLLs are over 1 MB in size,
then skip an address to allow more room.
Use a Process viewer (like Dependency Walker) to verify that your address space as no conflicts. If you do cause a
conflict, the Windows loader will resolve it for you automatically.
IMAGE_BASE ########h will be added to the Export file with the address specified, if the target file is a DLL.
35
Template Guide
There is a setting in the Version Resource File that is not directly controlled by the templates. This is the
"OriginalFilename" VALUE that is set from the value of the Project "Target file".
For example, if your target file is set to "CWHH60.DLL", then the .version file will contain the following line:
VALUE "OriginalFilename", "CWHH60.DLL\0"
In the Clarion LIBSRC folder, there is a default.version file the contains default information for the following template
prompts:
VALUE "CompanyName", "Default Company\0"
VALUE "LegalTrademarks", "Trademark\0"
VALUE "LegalCopyright", "Copyright (c) 2003\0"
VALUE "Language", "U.S. English\0"
VALUE "CodePage", "Multilingual\0"
These values can be removed or edited as needed. Do not delete the default.version file.
Product Version
Use External Product Information
Check this box if you would like to include the product information from an external source file. Enter a Source Version
File to include. This file must conform to the proper Version string information standards required by the resource file.
This is useful when compiling multiple applications that are all used with a product theme, like a payroll or accounting
package.
Product Name (Required)
Enter the name of the product that is associated with this file. For example, you may distribute a special utility or tool that
is associated with an overall accounting software package.
Product Major Version (Required)
Enter an integer that represents the major version of the product that this file is distributed for.
36
Template Guide
37
Template Guide
Code Page
Select a valid Code Page to assign to the Version Information. The default value is multilingual.
Clarion
Include Clarion Version Information
Check this box if you would like to include Clarion specific information into the generated Version output. You can override
the Clarion Version, Template family, and Template version information that is extracted by the template.
User
Additional string information that will appear in the Version Info list located on the Version tab can be added here (up to 4
entries). Enter a label and corresponding value in the template prompts provided.
38
Template Guide
To allow window resizing you must set the WINDOW's frame type to Resizable and you must check the Immediate box to
add the IMM attribute to the WINDOW.
Overriding Resize for a specific control
Resizer Configuration Options
Resize Strategy
Specifies the method for resizing and repositioning the controls to fit within the new window size.
Centered
With this strategy, all controls will keep its size and the position will change to stay centered in the window.
Use Anchor:
This option by default works the same way as the Centered option, but also moves additional anchor strategies to each
control’s Action Tab. The resizing strategy works using "Anchors" to define how the control will behave on the resize with
regard to its parent control.
Parent controls can be a TAB, OPTION, GROUP, or a WINDOW. For example, a RADIO control will anchor based on the
OPTION resize direction.
As far as all resize strategies are concerned, a control’s parent control is identified by its position on the window and not
how it is defined structurally. For example, if a BUTTON is defined outside of a TAB control, but its default physical
position is located within the TAB control, the TAB control is the actual parent control for that BUTTON.
Anchoring is based on what window edge is resized. For example, if a control is set to Anchor:Left, resizing the window’s
left edge will move the control proportionally to the left. If a control is set to Anchor:Right, resizing the window’s right edge
will move the control proportionally to the right.
The anchors define which edge of the parent control the control will be bound. Possible values for Anchor Strategy are
Anchor:Right, Anchor:Left, Anchor:Top, and Anchor:Bottom
To make these options easy to use, setting this strategy enables the Set Resize Control’s Anchors button located on
each control’s Actions tab.
This dialog allows you to specify which edge of the parent control that the target control will be bound (anchored) to.
In addition to the anchor buttons shown above (T,B,L,R), there are additional buttons (^,V, <, > ) that allow the control’s
target edge to resize proportionally in the active vertical or horizontal direction. For example, if a window is resized on top,
what control edge will "grow" proportionally based on the amount of sizing?
To better illustrate the use of anchor and the grow buttons, click here for a detailed example.
Resize
The generated code scales all window coordinates by the same amount, thus preserving the relative sizes and positions
of all controls. That is, all controls, including buttons and entry fields get taller and wider as the window gets taller and
wider. Window fonts are unchanged.
39
Template Guide
Spread
The generated code applies the following strategies to the respective control types:
Button
Only the horizontal position (X coordinate) is scaled with the window; width, height, and vertical position are unchanged.
Radio Button
Horizontal and vertical position are scaled with the window, but width and height are unchanged.
Check Box
Horizontal and vertical position are scaled with the window, but width and height are unchanged.
Entry
Width, horizontal and vertical position are scaled with the window, but height is unchanged.
Combo Box
Width, horizontal and vertical position are scaled with the window, but height is unchanged.
Spin Box
Width, horizontal and vertical position are scaled with the window, but height is unchanged.
Drop Combo
Width, horizontal and vertical position are scaled with the window, but height is unchanged.
Other Controls
All coordinates are scaled with the window.
Surface
Makes the most of the available pixels by positioning other controls to maximize the size of LIST, SHEET, PANEL, and
IMAGE controls. We recommend this strategy for Wizard generated windows.
Even though list boxes may be resized, the column widths within the list box are not resized. However, the right-most
column does expand or contract depending on the available space.
For this strategy, you may add the SCROLL attribute to each control plus the HVSCROLL attribute to the window to
provide a 'moving window' over a larger page.
40
Template Guide
Minimum Height
Specify the minimum height of the window in dialog units. Dialog units are based on the window's font and are 1/8 of the
character height.
Zero sets the window minimum to the size at which the window opens (not necessarily the design time size). In other
words, it takes into account any .INI setting plus any runtime Property syntax. Thus, we allow the developer to open the
window, perform any dynamic control production (including resizing the window) before the minimum restriction takes
effect.
Lock Width The control's design time width does not change.
41
Template Guide
Move The entire control moves in the direction of the parent’s horizontal resizing.
Lock Position The control's left edge maintains a fixed distance (the design time distance)
from parent's left edge.
Fix Right The control's right edge maintains a proportional distance from parent's right
edge.
Fix Left The control's left edge maintains a proportional distance from parent's left edge.
Fix Center The control's center maintains a proportional distance from parent's center.
Fix To Center The control's center maintains a proportional distance from it’s own center, not
the parent’s center.
Move The entire control moves in the direction of the parent’s vertical resizing
Lock Position The control's top edge maintains a fixed distance (the design time distance)
from parent's top edge.
Fix Bottom The control's bottom edge maintains a proportional distance from parent's
bottom edge.
Fix Top The control's top edge maintains a proportional distance from parent's top edge.
Fix Center The control's center maintains a proportional distance from parent's center.
42
Template Guide
Fix To Center The control's center maintains a proportional distance from it’s own center, not
the parent’s center.
43
Template Guide
Script Path Specify the path for the Install script. This is specific to this application
Overwrite with Check this box to copy the default Wise Script (installed to your
default .wse \TEMPLATE directory) to your application's local directory (overwriting
the local script). Clear the check box if you want to maintain the local
script file for this application.
Include External Check this box if you want the runtime DLLs included in this installation
DLLs script.
Application Title Specify the name of your application as you want it to appear on the
shortcut the installation creates.
Program Group Specify the name of the program group you want the installation to
Label create.
Default Folder Specify the folder you want the installation to offer in its "Select Folder"
step..
Additional Files to Press this button to add other files (e.g., on-line documentation, data
Install files, etc.). These files are added to the installation script. When adding
files, you can also specify whether or not to create a shortcut for each file
and the label to display for the item.
The Wise script this template creates does not list install files in the Wise for Clarion environment.
44
Template Guide
In Clarion terms, a business rule refers to your business data values stored through the application and to the constraints
on attempted changes to those data values.
Business rules are precise statements that describe, constrain, and control selected data elements within your application.
The Global Extension allows you to define rules that can be used throughout your application. In each procedure, you can
choose to override all, or part, of these business rules.
The Business Rules Manager template provides the following global prompts:
Mode:
Original/Clone selection
The Global Extension operates in one of two modes. In Original mode, all of the prompts described in this Help topic
appear. When code is generated, the information entered is exported to a file. In Clone mode, only the Mode prompts
appear. The extension imports rules information from the file.
This feature allows you to use the Global Extension in multiple-DLL projects without having to re-enter
business rules for each DLL.
All Rules:
The Business Rules Manager template provides to the user at runtime a display window containing a list of rules, and
displays any errors made (rules broken) based on the data entered (or not entered).
Default Description
Enter a default description to use for the title bar of this window.
Error-indicator image
Enter an icon image to use that will identify rules errors to the user within the rules list.
Global Rules
Press this button to access the Global Rules dialog
The specified controls above may be disabled or hidden when the window is first opened, after a rule check reveals one
that is broken.
Control STRING(128)
Description STRING(256)
Expression STRING(512)
46
Template Guide
Global Rules
The Global Rules dialog window allows you to define unlimited sets of Business Rules. Examples might be Global Rules,
Customer Rules, Product Rules, Invoice Rules, etc.
Use the appropriate update buttons to add a new set of rules, modify an existing set, or delete an existing set. The
following prompts are provided in the update dialog window:
Name
Enter a meaningful name to define your rules set. Example: GlobalRules, CustomerRules, etc. Note: No spaces are
allowed in this name set.
Description
Enter a textual description that describes the rules set. Example: Customer Information Rules
In the Global Rules update dialog, you are provided with a list of the specific rules that are contained in the defined set.
Use the update buttons to add, modify, or delete these specific rules. The following prompts are provided:
Rule Name
Enter a specific rule name here. The rule name must be in a variable format (e.g. – no spaces, colons and underscore
characters permitted, etc.)
Rule Description
Enter a meaningful description of the specific rule that you have defined. Example: "This rule checks if the customer is
domestic (CUS:Country = USA)"
Field to link to
Press the ellipsis button to select a valid field name to link the specific rule to, which will be evaluated whenever this field
is populated, or added to the Rules Hot Field list (found in the procedure based Local Rules template).
47
Template Guide
Controls Button
Press the Controls button to open a dialog window used to identify a set of generic controls (identified by Field Equate
Labels) which will be enabled or unhidden when the rule is evaluated to "True", or disabled or hidden when the rule is
evaluated to "False".
48
Template Guide
Rules - Controls
Enable/Disable Controls
Press the update buttons to add, change, or remove, selected controls that will be automatically enabled if the specific
rule that you have defined evaluates to a "True" condition. If the specific rule defined evaluates to a "False" condition, the
controls in the list box will be automatically disabled. Enter a Field Equate Label of the control that you expect to evaluate.
Hide/Unhide Controls
Press the update buttons to add, change, or remove, selected controls that will be automatically unhidden if the specific
rule that you have defined evaluates to a "True" condition. If the specific rule defined evaluates to a "False" condition, the
controls in the list box will be automatically hidden. Enter a Field Equate Label of the control that you expect to evaluate.
49
Template Guide
Hot Fields
Press this button to designate special hot fields that may or may not be populated on your window, but are included in
the business rules that you need to check.
50
Template Guide
The specified controls above may be disabled or hidden when the window is first opened, after a rule check reveals one
that is broken.
51
Template Guide
The Local Rules dialog window allows you to define unlimited sets of Business Rules. Examples might be Customer
Rules, Product Rules, Invoice Rules, etc.
Use the appropriate update buttons to add a new set of rules, modify an existing set, or delete an existing set. The
following prompts are provided in the update dialog window:
Name
Enter a meaningful name to define your rules set. Example: CustomerRules, etc. Note: No spaces are allowed in this
name set.
Description
Enter a textual description that describes the rules set. Example: Customer Information Rules
In the Local Rules update dialog, you are provided with a list of the specific rules that are contained in the defined set.
Use the update buttons to add, modify, or delete these specific rules.
Press the Insert button to add a Hot Field, and on the subsequent dialog, press the ellipsis to select a hot field from the
Field Selection List.
52
Template Guide
Rule Name
Enter a specific rule name here. The rule name must be in a variable format (e.g. – no spaces, colons and underscore
characters permitted, etc.)
Rule Description
Enter a meaningful description of the specific rule that you have defined. Example: "This rule checks if the customer is
domestic (CUS:Country = USA)"
The specific rule that you define will always return a zero if the expression you enter evaluates to "False".
Field to link to
Press the ellipsis button to select a valid field name to link the specific rule to. Whenever this field is populated or added to
the Rules Hot Field list (found in the procedure based Local Rules template)
Controls Button
Press the Controls button to open a dialog window used to identify a set of generic controls (identified by Field Equate
Labels) which will be enabled or unhidden when the rule is evaluated to "True", or disabled or hidden when the rule is
evaluated to "False".
53
Template Guide
Hide/Unhide Controls
Press the update buttons to add, change, or remove, selected controls that will be automatically unhidden if the specific
rule that you have defined evaluates to a "True" condition. If the specific rule defined evaluates to a "False" condition, the
controls in the list box will be automatically hidden. Enter a Field Equate Label of the control that you expect to evaluate.
Hide/Unhide Controls
Press the update buttons to add, change, or remove, selected controls that will be automatically unhidden if the specific
rule that you have defined evaluates to a "True" condition. If the specific rule defined evaluates to a "False" condition, the
controls in the list box will be automatically hidden. Enter a Field Equate Label of the control that you expect to evaluate.
54
Template Guide
Select a rulebase name from the list, and press the Properties button. The following prompts are available:
Controls Button
Press the Controls button to open a dialog window used to identify a set of generic controls (identified by Field Equate
Labels) which will be enabled or unhidden when the rule is evaluated to "True", or disabled or hidden when the rule is
evaluated to "False".
55
Template Guide
Code Templates
Select Embed Type
This dialog lets you specify what to embed at this point. CLICK on the item to embed, then press the Select button.
The choices are:
Call a procedure Provides a dialog that lets you specify a procedure to call.
SOURCE Calls the Text Editor, allowing you to hand code the embedded source.
Code Templates The templates listed here depend on the templates you have registered.
Code templates generate executable code. Generally, each Code
template has one well-defined task. For example, the Initiate Thread
Code template simply starts a new execution thread, and no more.
Typically, the Code template provides a dialog box with options and
instructions.
There are many Code Templates included with Clarion (see the help TOC for a complete list):
56
Template Guide
57
Template Guide
The ADO Browse Refresh Code Template allows you to refresh an ADO Browse contents at nearly any source embed
point. This is useful when a data value is updated, and its value directly affects the browse box contents.
The code template has no prompts, and simply calls the ADO object’s Refresh method.
The ADO Browse to XML Code Template allows you to export the contents of an active browse box to an external XML
file. The appropriate XML tags are automatically added to the file.
Press the ellipsis to select a variable that will hold the XML external filename. The variable must hold the full path and
filename. If the path is omitted, the current program directory is used.
CallABCMethod
The CallABCMethod template generates code to call an ABC Library object method. This template generates code similar
to the following:
Default:City = INIMgr.Fetch('Preferences','City')
Object Name
Select the label of the object from the list. The list contains all ABC compliant objects in scope for this procedure.
Method to Call
Select the method to call from the drop-down list. Scroll the list horizontally or press the Application Builder Class
Viewer button to see all the method parameters and return values.
Passed Parameters
Type the parameter list to pass. Enclose the parameters in parenthese and separate them with commas. The parameters
may be literal values, expressions, or variable names. Press the E button to call the Expression Editor. This dialog is used
to help you construct syntactically correct expressions to use in the Passed Parameters prompt.
Return Value Assignment
Type the variable to receive the called method's return value. This field is only available for methods that return a value.
Application Builder Class Viewer
Press this button to display classes, properties, and methods used by the ABC Templates, and the relationships between
parent and derived (child) classes. This utility can help you analyze and understand the classes that the ABC Templates
use.
58
Template Guide
This code template is similar to the actions available in the Menu Editor , and adds extended features through the
following template prompts:
Action Choose Call a Procedure or Run a Program from the drop list provided.
The remaining prompts are similar to those found in the Menu Editor for each menu item’s actions, and are shown below:
Procedure Definition Prompts
Procedure Name From the Procedure Name drop down list, choose an existing procedure
name, or type a new procedure name. A new procedure appears as a
"ToDo" item in your Application Tree.
Initiate a Thread Optionally check the Initiate a Thread box. If the procedure initiates a
thread, specify the Thread Stack size. Clarion uses the START function
to initiate a new execution thread. You can optionally specify
Parameters, Requested File Action, or both.
Thread Stack Accept the default value in the Thread Stack spin box unless you have
extraordinary program requirements. To change the value, type in a new
value or click on the spin box arrows.
Return Thread If the thread procedure called is prototyped to return a value, press the
Variable ellipsis button here to select a variable to receive the returned value.
Requested File From the drop down list, optionally select None, Insert, Change, Delete,
Action or Select. The default selection is None. The Global Request variable
gets the selected value. The called procedure can then check the value
of the Global Request variable and perform the requested file action.
Return Value If the procedure called is prototyped to return a value, press the ellipsis
Variable button here to select a variable to receive the returned value.
Optionally check the Reference Assign check box if the variable defined
is a reference variable.
59
Template Guide
Program Name Type the program name. The program name must be in your path or
current folder, else enter the full path and executable program. Quotes
are added to your entry so you don't need to enter any.
Parameters Optionally type a list of values that are passed to the program. Press the
"E" button to call the Expression Editor. This dialog is used to help you
construct syntactically correct expressions to use in the Parameters
prompt.
Code before Type in any executable code to execute before performing the lookup.
Multiple statements can be used if separated by a semicolon.
Code After, Type in any executable code to execute after completing a lookup.
Completed Multiple statements can be used if separated by a semicolon.
Code After, Type in any executable code to execute if the lookup is canceled.
Canceled Multiple statements can be used if separated by a semicolon.
Press the E button where appropriate to call the Expression Editor. This dialog is used to help you construct syntactically
correct expressions to use in the appropriate prompts.
60
Template Guide
DisplayPopupMenu
The DisplayPopupMenu template generates code to define and display a popup menu, and optionally, act on the end
user's selection. You can set the popup menu items to mimic existing buttons on the window so that the associated menu
item text matches the button text, is enabled only when the button is enabled, and, when selected, invokes the button
action. The DisplayPopupMenu template relies on the PopupClass to accomplish its tasks.
String variable for Press the ellipsis (...) button to select or define a string variable to
receive the end user's popup menu selection. After the popup menu
displays, this variable contains the selected item's text minus any special
characters. That is, the variable contains only characters 'A-Z', 'a-z', and
'0-9'. If the resulting value is not unique for the menu, the PopupClass
appends a sequence number to the value to make it unique.
You may interrogate this variable and perform actions depending on its
value. If you rely on the PopupClass mimic capability to perform
appropriate actions, then you can leave this field blank. See Item
Properties for more information on mimic.
Build Menu From Choose how the popup menu and its items are defined. Choose from:
Menu String Use the Menu String field to type the menu definition, then use the Item
Properties to define each item's behavior.
Item List Use the Menu Items button to define menu items one at a time.
INI File Use the Menu Description field to name the INI file section which
contains the menu definition. By default, the template code uses the
global INIMgr object declared by the ABC Application template. If you
have not specified an INI file to use, the INIMgr object uses Windows INI
file. See Template Overview—Global Options Tab.
Menu Description Type the INI file section which contains the menu definition.
Menu String Type a menu definition string. The Language Reference describes the
syntax for the menu definition string under the selections parameter for
the POPUP command.
Item Properties Press this button to define the properties for each popup menu item.
Only items specified in the Menu String are valid. You can set the popup
menu items to mimic existing buttons on the window so that the
associated menu item text matches the button text, is enabled only when
the button is enabled, and, when selected, invokes the button action.
You can also set the popup menu items to post an event to a control.
Menu Items Press this button to define the text for each popup menu item. You can
set the popup menu items to mimic existing buttons on the window so
that the associated menu item text matches the button text, is enabled
only when the button is enabled, and, when selected, invokes the button
action. You can also set the popup menu items to post an event to a
control.
Classes Tab
Use the Classes tab to override the global settings for the Class. See Classes Tab.
61
Template Guide
The Export to XML code template is used to write the contents of a valid data source (or origin) to an external XML file.
This code template is actually a wrapper around the built-in class library support for XML parsing.
The following prompts are provided:
Data Origin Press the ellipsis button to select a valid label of a GROUP, FILE, VIEW or
QUEUE that holds the XML contents to export to an XML file. Press the "E"
button to call the Expression Editor. This dialog is used to help you construct
syntactically correct expressions to use in the Data Origin prompt.
Mapping File Press the ellipsis button to select a valid XML mapping file to use during the
export process. In Clarion terms, mapping refers to associating an XML tag
or schema to a database column name. If you wish to select this file at
runtime, check the Select mapping file at runtime check box. You may also
specify a variable here (Example: !FilenameVariable).
Export File Press the ellipsis button to select the valid XML source file name to export to.
If you wish to select this file at runtime, check the Select export file at
runtime check box. You may also specify a variable here (Example:
!FilenameVariable).
Root Tag: Enter a hard coded string value, or specify a variable that will identify the root
tag name (using the !variablename format) to begin the export to.
Row Tag: Enter a hard coded string value, or specify a variable that will identify the row
tag name (using the !variablename format) to begin the export to.
Root and Row Tags can contain letters, numbers, and other characters. They must not start with a number or punctuation
character or with the letters xml (or XML or Xml ..). They cannot contain spaces
XML Style Select Tag-based or Attribute-based. This setting controls the XML formatted
output style.
For more information, please review the Clarion XML Support Reference Guide PDF file included in your install.
62
Template Guide
63
Template Guide
Target Variable Press the ellipsis button to select a variable name that will store the value
of the FULLDRAG() API. This variable should be a numeric type.
Source Equivalence: Target Variable = FULLDRAG()
Target Variable Press the ellipsis button to select a variable name that will store the value
of the runtime property. This variable should be a STRING or CSTRING
type.
Source Equivalence:
<Target Variable> = SYSTEM{PROP:WindowsVersion}
64
Template Guide
Import File Press the ellipsis button to select a valid XML source file to import. If you
wish to select this file name at runtime, check the Select import file at
runtime check box. You may also specify a variable here (Example:
!FilenameVariable).
Mapping File Press the ellipsis button to select a valid XML mapping file to use during
import. In Clarion terms, mapping refers to associating an XML tag or
schema to a database column name. If you wish to select this file at
runtime, check the Select mapping file at runtime check box. You may
also specify a variable here (Example: !FilenameVariable).
Destination Press the ellipsis button to select a valid label of a GROUP, FILE, VIEW
or QUEUE to hold the contents of the import XML file.
XML Style Select Tag-based or Attribute-based. This setting controls the XML
formatted output style.
For more information, please review the Clarion XML Support Reference Guide PDF file included in your install.
65
Template Guide
66
Template Guide
Lookup Key Type in the key name or press the ellipsis (...) button to select the key
from the Select Key dialog.
The lookup key is used to perform the lookup into the lookup file. This
must be a unique key. If the key is a multi-component key, the other key
elements must be primed before executing this Code template.
Lookup Field Type in the field name or press the ellipsis (...) button to select the field
from the Component list.
The Lookup Field must be a component of the Lookup Key. This is the
unique value within the lookup file.
Related Field Type in the related field or press the ellipsis (...) button to select it from
the Select Column dialog.
The Related Field provides the unique value used to perform the lookup.
67
Template Guide
ResizeSetStrategy
The ResizeSetStrategy template lets you override the default resize strategy for a particular control. It is designed
exclusively for the Set resize strategy embed point for a specific control. See WindowResize extension template for more
information on the default resize strategies.
Insert the code template at the Set resize strategy embed point for the control for which to set the resize strategy, then
complete the following prompts.
Horizontal Resize Specify how the control's width is determined when the end user
Strategy resizes the window. Choose from:
Lock Width The control's design time width does not change.
Vertical Resize Specify how the control's height is determined when the end user
Strategy resizes the window. Choose from:
Lock Height The control's design time height does not change.
Horizontal Positional Specify how the control's horizontal position is determined when
Strategy the end user resizes the window. Choose from:
Lock Position The control's left edge maintains a fixed distance (the design time
distance) from parent's left edge.
Fix Right The control's right edge maintains a proportional distance from
parent's right edge.
Fix Left The control's left edge maintains a proportional distance from
parent's left edge.
Vertical Positional Specify how the control's vertical position is determined when
Strategy the end user resizes the window. Choose from:
Lock Position The control's top edge maintains a fixed distance (the design
time distance) from parent's top edge.
68
Template Guide
Fix Top The control's top edge maintains a proportional distance from
parent's top edge.
…to tie the navigation buttons to the active Form procedure (that is, the SaveButton Control template).
SetABCProperty
The SetABCProperty template generates code to set a public property of an ABC Library object. This template generates
code similar to the following:
BRW2.ActiveInvisible = True
Object Name
Select the label of the object from the list. The list contains all ABC compliant objects in scope for this procedure.
Property to Set
Select the property to set from the drop-down list. See ABC Library for more information on these properties.
Value to Set
Type a variable, constant, or valid Clarion expression to assign to the property.
Assign as Reference?
Check this box to generate a reference assignment (object.property &= value). Clear the box to generate a simple
assignment (object.property = value). See Reference Assignments in the Language Reference for more information.
69
Template Guide
Turn On Check this box to enable full window dragging in your application.
Use this code template to force full window dragging if you want to force this look and feel in your applications, or a user’s
operating system is having problems with the Enable Window Frame Dragging setting in the application’s Global
Properties.
The best place to include this template is any embed point that is available prior to opening the Application Frame.
Control Select the field equate label for one of the window controls from the drop
down list.
Property Select the runtime property to set from the drop down list.
70
Template Guide
This code template is used to export contents to an XML file’s from the designated data origin.
Data Origin
Press the ellipsis button to select a valid label of a GROUP, FILE, VIEW or QUEUE that holds the XML contents to export
to an XML file. Press the "E" button to call the Expression Editor. This dialog is used to help you construct syntactically
correct expressions to use in the Data Origin prompt.
Export file
Press the ellipsis button to select the valid XML source file name to export to. If you wish to select this file at runtime,
check the Select export file at runtime check box. You may also specify a variable here (Example: !FilenameVariable).
Mapping file (optional)
Press the ellipsis button to select a valid XML mapping file to use during the export process. In Clarion terms, mapping
refers to associating an XML tag or schema to a database column name. If you wish to select this file at runtime, check
the Select mapping file at runtime check box. You may also specify a variable here (Example: !FilenameVariable).
Root Tag:
Enter a hard coded string value, or specify a variable that will identify the root tag name (using the !variablename format)
to begin the import from.
Row Tag:
Enter a hard coded string value, or specify a variable that will identify the row tag name (using the !variablename format)
to begin the import from.
XML Style
Select Tag-based or Attribute-based. This setting controls the XML formatted output style.
71
Template Guide
72
Template Guide
Control Templates
Select Control Template
This dialog lets you choose a control template to add a control plus its supporting source code to your procedure.
CLICK on a control template from the list, then press the Select button.
If you check the Translate controls to control templates when populating box on the Application Properties dialog,
the list contains control templates and controls without templates. This is primarily a reminder that control templates with
their built-in functionality are available as an alternative to do-it-yourself controls.
If you add third party, or your own customized templates to the Template Registry, they appear in the list. The following
lists the control templates which ship with the Clarion ABC/Clarion templates:
ASCII View control template This control template adds a list box in which you can display an
ASCII (text) file.
ASCII Print Button This control template adds a button to print an ASCII (text) file.
ASCII Search Button This control template adds two buttons (Find and Find Next) to
search an ASCII (text) file using object oriented code.
Browse Fuzzy Matching The BrowseFuzzyMatching template adds a set of controls that
lets end users perform a weighted search on the data in a
BrowseBox. The controls include an entry field, a search button,
a clear search button, and a group control that surrounds them.
BrowseNoRecords Button This template populates a button that becomes enabled only
when there are records displayed in a related Browse Box.
BrowsePrint Button This template populates a button that selects a single record for
you to print or process.
Browse QBE Button Populates a button that calls a designated List or Form query
interface.
Browse Select Button This control template provides a quick way to return a value from
a list box called to request a record.
73
Template Guide
BrowseToolbox Button This control template populates a button that calls a popup
toolbox that allows access to common database activities (Insert,
Change, Query, etc.).
Browse Update buttons This control template provides a quick way to manage records in
a list box.
Close Button This control template adds a single button control marked Close
which closes down the current window.
DOS File Lookup This control template adds an ellipsis (...) button which leads the
end user to a standard Open File dialog.
Dynamic Image The DynamicImage control provides an image control that must
be placed within an existing BrowseGrid control.
Field Lookup Button This control template adds an ellipsis (...) button to call a lookup
procedure specified for an entry control.
File Drop This control template adds a drop down list showing the contents
of a selected field of a file listed in the data dictionary.
File Drop Combo This control template adds a Combo Box with drop down list
showing the contents of a selected field of a file listed in the data
dictionary. It also allows updates to the file.
Help Button This control template populates a button that allows you to call
the help topic created for this window.
OLE Control This control template adds an OLE control plus callback
functions if the OLE contains an OCX.
74
Template Guide
Relation Tree Update Adds buttons to a window which call the appropriate update
Buttons procedures for levels in a Relation Tree.
Relation Tree Adds buttons to a window which expand and contract all the
Expand/Contract Buttons levels in a Relation Tree.
RTFTextControl Adds a TEXT control that manipulates the text within the control
as Rich Text.
RTFToolbar Adds a set of buttons that provides a wide variety of functions for
a related RichText Control.
Save Button This control template adds an OK button to close a window and
save the action.
SaveChange Button This template is normally used along with the FormVCR control
template to allow writes of a record’s contents to a data file.
SortOrder Button This template populates a button that provides a popup menu of
browse sort order choices.
SortOrder Drop This template populates a drop list that provides a list of browse
sort order choices.
75
Template Guide
The ADO Browse Box Control template provides the extensive features of the standard Browse Box control, and
managed through an ADO connection layer.
In addition, there are new features that extend the functionality of the standard Browse Box, including:
Ability to change column position at runtime, by dragging the appropriate column to its new position.
Ability to click on a column header and sort by that column at runtime. You can also SHIFT click on an
additional header in order to add another column to the sort order sequence. SHIFT click again to change the
order from ascending to descending.
Ability to HIDE/UNHIDE columns by pressing CTRL+RIGHTCLICK in the data area of the ADO Browse Box at
runtime.
More powerful template-based filtering options.
General
Loading Method
Select Page or Table from the drop list provided. Page tells the Browse Box to return a page of records to the client when
requested. Table returns all records of the primary table used in the Browse Box, unless limited below.
Maximum rows
Specify a maximum number of rows to return. This prompt is only available if the Limit the result set rows number
check box is checked.
76
Template Guide
DB Interface Group:
DB Interface object
The Database Interface object name is generated by the ADO template. If you need to override the default object
name, enter a new name here.
CRecordset Attributes
Press the Crecordset Attributes button to access special properties that affects the ADO recordset. Each
attribute is described in detail in the ADO Reference provided by Microsoft.
Cursor Location
The CursorLocation property on a Connection object or Recordset object indicates the location of the cursor
engine.
Cursor Type
The CursorType property on a Recordset object indicates the type of the cursor engine.
LockType
The LockType property is used to set the type of locks placed on records that the provider should use when
opening the Recordset.
Command Type
The CommandType property on a Recordset object Indicates the type of a Command object.
Execute Options
The Execute method on a Connection object executes the statement specified in the CommandText property
In ADO, when you have created a SELECT statement through your template design that contains the same column name,
but coming from a different table, the fields’ collection will have field objects with the same name.
For example,
SELECT Customer.SysID, order.SysId etc…
The Fields collection above will have 2 Field objects with the name SysID. In order to make sure that the values from
those 2 fields will go into the right application variable, we need to know which table the field belongs to. There is a
property in the Field properties collection called BASETABLENAME that provide this value.
77
Template Guide
Data Columns
The Data Columns list box displays data elements that have been populated via the List Box Formatter. Press the
Properties button to access the following prompts:
Query Field
Identifies a column as a field that can be queried (searched).
Column is a
Identifies the data element as one that is read directly from the ADO data source (Table Column), or one that is a
variable defined within the application, like a computed or conditional field (Expression).
Use AS
Check this box if the column name is long and verbose, and you need to rename the column to a more descriptive
and compacted name. This is useful if you are constructing long or complex SQL statements. This is an option for
Table Columns, but required for all Expressions.
Expression
Enter a valid expression to use for the defined Data Column
78
Template Guide
Use the This Column is the Default sort column check box to set the column to use as the default locator.
Hot Fields
The Hot Fields list box displays data elements that have been populated outside of the List Box Formatter, or data
elements that may not be populated, but need to be referenced or updated in the procedure source. Hot fields are
normally data elements that are related to the contents of the list box (i.e., Address information, text based descriptions,
etc.). Press the Properties button to access the following prompts:
Hot Field
Press the ellipsis button to select a field to use as the hot field.
Column is a
Identifies the data element as one that is read directly from the ADO data source (Table Column), or one that is a
variable defined within the application, like a computed or conditional field (Expression).
Use AS
Check this box if the column name is long and verbose, and you need to rename the column to a more descriptive
and compacted name. This is useful if you are constructing long or complex SQL statements. This is an option for
Table Columns, but required for all Expressions.
Expression
Enter a valid expression to use for the defined Data Column
Default SQL
Because the SQL to access the data is vitally important, the ADO templates allow you to view the generated SELECT
statement and customize it if necessary. This also provides a convenient way to customize the browse ordering, should
you wish.
Regenerate SQL
Press this button to reset the original template-constructed SQL statements. This is useful should you need to start from
scratch again before customizing your statements. Only enabled when the next prompt is active (checked).
79
Template Guide
Default Behavior
The default behavior of the ADO Browse Box has a much different interface than the standard browse box. You will also
notice that the filter capabilities are expanded in the ADO template. The following prompts are available:
Fields Tab:
The Fields tab control provides control of your browse box filtering and sorting features.
Column
Select a column name from the drop list provided to use as criteria for the browse filter or range. The columns
displayed are those columns you have defined in the Data Columns/Hot Fields dialog.
80
Template Guide
In the case where you are using static values, you are responsible to enter the values with the necessary single
quotes. For example, if you are using the IN filter criteria, and need to check several parameters enter 'Test',
'Test2',’TestN’ in the Single Value line. For static values, you need to enter single quotes where needed.
Range of Values
Lets you specify upper and lower limits. Specify the variables containing the limits in the Low Limit Value and
High Limit Value boxes.
Less Than
Lets you limit the records read to all records less than a single value. Specify the variable containing that value
in the Range Limit Value box which appears.
Great Than
Lets you limit the records read to all records greater than a single value. Specify the variable containing that
value in the Range Limit Value box which appears.
IN
Lets you limit the records read to all records that match the contents of a single value.
Begins with
Lets you limit the records read to all records that begin with the contents of a single value.
Ends with
Lets you limit the records read to all records that end with the contents of a single value.
Contains
Lets you limit the records read to all records that begin with the contents of a single value.
Sort Columns
Press the update buttons to add (Insert), modify (Properties), or remove (Delete) the browse sort column(s). These are
the data elements used to sort the records displayed in your Browse Box. Clicking on the column header activate the
column sort.
81
Template Guide
Column
Select a column name from the drop list provided to use as criteria for the browse filter or range. The columns
displayed are those columns you have defined in the Data Columns/Hot Fields dialog.
Direction
Choose ASC from the drop list to designate an ascending sort, or DESC to specify a descending sort.
Essentially, the settings of the Range or Filter are used to generate the SQL WHERE clause, and the Sort Columns
setting are used to generate the ORDER BY clause.
82
Template Guide
Press this button to test the SQL statement. If a statement clause is not overridden, the statement will be regenerated
based on the template’s current settings.
Conditional Behavior
The Conditional Behavior tab duplicates the prompts and resultant functions found on the Default Behavior tab, with the
addition of a Condition prompt:
Condition
Enter any valid Clarion expression.
Colors
The Colors dialog of the ADO Browse template presents the exact functionality as the standard browse box.
Icons
The Icons dialog of the ADO Browse template presents the exact functionality as the standard browse box.
Styles
The Styles dialog of the ADO Browse template presents the exact functionality as the standard browse box.
Tooltips
The Tooltips dialog of the ADO Browse template presents the exact functionality as the standard browse box.
Totaling
The Totaling dialog of the ADO Browse template presents the exact functionality as the standard browse box.
Classes
Use the Classes tab to override the global settings for the Class. See Classes Tab.
83
Template Guide
The ADO BrowseSelectButton template provides Select button to choose a record from An ADO browse (list) box.
The generated source code gets the currently selected record from the list (makes the selected record the current one in
the browsed file's record buffer), and closes down the procedure. For the end user, pressing the Select button is
equivalent to double-clicking an item in the list.
The BrowseSelectButton template provides the following prompts:
Procedure Parameters
Allows you to specify parameter names (an optional list of variables separated by commas) for your process procedure,
which you can pass to it from the calling browse procedure. You must specify the functionality for the parameters in
embedded source code.
Example:
(LOC:HideID,GLO:AccessLevel)
84
Template Guide
Procedure Parameters
Allows you to specify parameter names (an optional list of variables separated by commas) for your update procedure,
which you can pass to it from the calling browse procedure. You must specify the functionality for the parameters in
embedded source code.
Example: (LOC:HideID,GLO:AccessLevel)
Set UNIQUETABLE
This checkbox will control the generation of code to set the value of UNIQUETABLE in the recordset for updating. If
checkbox is set, this will enable the UNIQUEVALUE Value prompt.
UNIQUETABLE Value
Press the ellipsis button to select the UNIQUETABLE (default value is the Primary file).
AffectRecords Parameter
This prompt defines the value that must be set for the AffectRecords parameter of the RESYNC command. Default value
is adAffectAll, but some back ends may only work with adAffectCurrent (e.g., Pervasive).
85
Template Guide
This control template adds a button to allow pausing and restarting of an ADO Process or Report procedure.
Pause Text
The text to display on the button when the process is running. This text alerts the user that the process can be paused by
pressing the button. The default is Pause.
Restart Text
The text to display on the button when the process is paused and multiple starts are allowed. This text alerts the user that
pressing the button can restart the process. The default is Restart.
Start Paused
The state of the control when the procedure starts. If check, the process is paused until the user presses the button.
Start Text
The text to display on the button when the procedure opens. This text alerts the user that the process can be strated by
pressing the button. The default is Go.
Allow Multiple Starts
Check this button to allow the process to start more than once.
When Pressed
The standard set of prompts for buttons. Normally, when using a Control template, these prompts are not used.
86
Template Guide
The ADO Save Button Control Template is used to update a series of data elements through an ADO connection. There
are several option that are unique and different from the standard Save Button used in ISAM and SQL database updates.
In the Save Button properties (found on the button’s Actions tab control) press the ADO/SQL Behavior button to access
the ADO/SQL Behavior dialog. The following prompts are available.
General Tab
Connection Group:
Connection Object
Choose a Connection object name from the drop list provided. This list should contain the connection object you
created in the ADO Global support template.
Use a New Connection
If you do not wish to use any of the Global Connections that are available, check this box to create a new
connection specifically for this browse box.
New Connection
Press this button to call the Connection Builder. You also have the option to create (derive) a new Connection
object to use instead of the global object; check the Generate a COMIniter object check box to enable this
feature.
Command Object
The ADO connection layer contains a default command object that is responsible for handling the appropriate data update
behavior. If you need to select an alternative object name, enter the value here.
In ADO, when you have created a SELECT statement through your template design that contains the same column name,
but coming from a different table, the fields’ collection will have field objects with the same name.
For example,
SELECT Customer.SysID, order.SysId etc…
87
Template Guide
The Fields collection above will have 2 Field objects with the name SysID. In order to make sure that the values from
those 2 fields will go into the right application variable, we need to know which table the field belongs to. There is a
property in the Field properties collection called BASETABLENAME that provide this value.
Columns Tab
The Columns tab control prompts are used to specify additional columns (fields) that need to be updated by the ADO
Form, but are not populated on the window.
By default, all data elements populated on the window that are part of the ADO file will be automatically updated as
needed.
In most cases, the records affected variable will return a 1 if the update to the ADO table was successful. A zero (0) will
be returned if the update to the ADO table was not successful.
SQL Tab
Override Generated SELECT
Check this box to bypass the auto generation of the SELECT statement by the templates. Your custom statement will
be substituted in its place. This box also enables the Regenerate SQL button, should you wish to reset the statement
back to its original value.
Regenerate SELECT
Press this button to reset the original template-constructed SQL statements. This is useful should you need to start
from scratch again before customizing your statements. Only enabled when the next prompt is active (checked).
Classes Tab
The Classes Tab contains information regarding the names of classes used by the ADO form templates. For more
information, see Classes Tab.
Help on the other Save button prompts are identical to the standard Save Button control template, and can be referenced
there.
88
Template Guide
The ADOLoginControls Control Template is used with the ADO Login Procedure to provide default login controls on the
window. This includes:
UserID
Password
Server
Blank Password check box option
Login and Cancel Buttons
When Pressed The standard set of prompts for buttons. Normally, when using a Control
template, these prompts are not used.
When Pressed The standard set of prompts for buttons. Normally, when using a Control
template, these prompts are not used.
89
Template Guide
File to Browse
Specifies the path and name of the file to view, or a variable containing the path and name of the file to view. The variable
must be preceded by an exclamation point (!).
If no path is specified, the procedure looks for the file in the current directory.
If omitted (left blank), the Viewer object prompts the end user to select a file.
Classes Tab
Use the Classes tab to override the global settings for the Class. See Classes Tab.
90
Template Guide
The AsciiViewInListBox template allows a LIST control to alternate its display between a selected file and some other data
that you specify.
The AsciiViewInListBox template provides the same functionality and the same prompts as the AsciiViewControl template.
See AsciiViewControl for more information. The AsciiViewInListBox template provides one additional prompt. Because it
is an Extension template and does not place its own control, the AsciiViewInListBox template prompts you for the LIST
control to use to display text:
General Tab
List box field to use
Select the LIST control that alternates its display.
Initialize Viewer
Determines when the procedure initializes the Viewer object. Initialization includes selecting the file to view, opening it,
and reading it.
On Open Window
Initializes the Viewer when the window opens so that the Viewer's LIST is full upon initial display.
On Field Selection
Delays initializing the Viewer until the end user selects the Viewer's LIST control.
Manually
Does not initialize the Viewer. You must embed a call to the Viewer#:Initialize ROUTINE to initialize the Viewer.
File to Browse
Specifies the path and name of the file to view, or a variable containing the path and name of the file to view. The variable
must be preceded by an exclamation point (!).
If no path is specified, the procedure looks for the file in the current directory.
If omitted (left blank), the Viewer object prompts the end user to select a file.
Allow popup menu searching
Check this box to provide a (RIGHT-CLICK) popup menu choice to search the file.
Allow popup menu printing
Check this box to provide a (RIGHT-CLICK) popup menu choice to print some or all of the records in the file.
Classes Tab
Use the Classes tab to override the global settings for the Class. See Classes Tab.
91
Template Guide
The BrowseBox Control template places a "page-loaded" or a "file-loaded" LIST control in a window and generates code
to fill the list with data, and to scroll, search, sort, and select the listed items. It generates code to select or filter the data,
total the data, update the data directly (edit-in-place), or call a separate procedure to update the data. It also generates
code to conditionally set the colors and icons associated with each row and column in the LIST. The standard BrowseBox
behavior is defined by the ABC Library's BrowseClass. See BrowseClass in the ABC Library Reference for more
information.
You can use the BrowseBox Control template to manage a page-loaded drop-list simply by setting the DROP attribute to
a value greater than zero (0) .
The LIST control's popup menu takes you to the List Box Formatter where you can choose which fields or variables
populate the list. You can also define how they appear in the list box (including enabling colorization and Icon display).
The Actions tab on the List Properties dialog provides the prompts which let you define the browse box's functionality,
including any record filters, range limits, totaling, scroll bar behavior, and locator behavior.
Actions
The Actions tab of the List Properties dialog (right-click the control and choose Actions) displays the template prompts
which let you specify numerous template options, as well as add custom embedded source code for standard list box
events, such as moving the selection bar. The dialog contains the following options:
92
Template Guide
Default Behavior
Table Schematic Description
Enter a descriptive string that will be displayed in the Table Schematic window for this particular control. This allows you
to distinguish one control from another when there are multiple controls populated in a single window.
Quick-Scan Records
Specifies buffered access behavior for file systems that use multi-record buffers (primarily ASCII, BASIC, and DOS). See
Database Drivers for more information. These file drivers read a buffer at a time, allowing for fast access. In a multi-user
environment these buffers are not 100% trustworthy, because another user may change a record between accesses. As a
safeguard, the driver refills the buffers before each record access.
Quick scanning is the normal way to read records for browsing. However, rereading the buffer may provide slightly
improved data integrity in some multi-user circumstances at the cost of substantially slower processing.
Loading Method
Select the method used to read the BrowseBox data from the drop-down list.
Page
Page-loading provides near-instantaneous displays for unfiltered data, even for very large datasets. Page-loading uses
less memory, because only a few records are held in memory at a time. On the other hand, page-loading can cause
erratic vertical scroll bar behavior as well as additional network traffic for each scroll or search action.
File
File-loading provides smooth, accurate vertical scroll bar behavior, plus no additional network traffic when scrolling and
searching. File-loading is also quite SQL friendly. On the other hand, file-loading can result in substantial delays and
heavy memory usage when reading large datasets.
93
Template Guide
Use a step locator when the first free key element is a STRING,
CSTRING, or PSTRING and you want the search to take place
immediately upon the user's keystroke. Step locators are not
appropriate for numeric keys. If there is no browse key, the
Application Generator converts to no locator. Step locators are
case-sensitive only if the key defined as the browse sort is defined
as case-sensitive.
The locator control should come after the LIST control in the Set
Control Order dialog.
When the end user places one or more characters in the locator
control, then accepts the control by pressing TAB, pressing a
locator button, or selecting another control on the screen, the list
box advances to the nearest matching record.
With a STRING control, when the list has focus, characters are
automatically placed in the locator string for each keystroke, and
the list box immediately advances to the nearest matching record.
The backspace key removes characters from the locator string.
94
Template Guide
The locator returns only the records that match the search value,
providing, in effect, a dynamic range limit or filter for the browse.
The Filter Locator performs very well on SQL databases and on high order key component fields; however, performance
may suffer if applied to non-key fields or low order key fields of non-SQL databases.
Override default locator control
The default locator control is the control whose USE attribute is the first free key element of the browse key. To override
this default and specify a different locator control, check this box. This option is provided in case you have multiple
controls with the same free key element as their USE attributes--that is, when you have both ascending and descending
keys on the same field.
Select one of the controls to use as the locator control from the New Locator Control list.
Find Method
Only available when the Filtered locator is selected. The Find Anywhere checkbox determines whether the FilterLocator
applies the search value to the entire field (field contains search value) or only to the leftmost field positions (field begins
with search value). If checked, it applies the "contains" test. If unchecked, it applies the "begins with" test. See FloatRight
for more information.
Locator Class
Press this button to override the global Locator Manager setting. See Classes Tab.
Record Filter
Type a valid Clarion expression to limit the contents of the browse list to only those records causing the expression to
evaluate to true (nonzero or non-blank). The procedure loops through all displayable records to select only those that
meet the filter. Filters are generally much slower than Range Limits.
You must BIND any file field, variable, or EQUATE that is used in a filter expression. The Hot Fields tab lets you BIND
fields.
95
Template Guide
Press the "E" button to call the Expression Editor. This dialog is used to help you construct syntactically correct
expressions to use in the Record Filter prompt.
Specify fields to sort on in addition to any Key specified in the Data / Tables Pad by typing an ORDER expression list (a
comma delimited list of field names). See ORDER in the Language Reference for more information.
Reset Fields button
Press this button to add Reset Fields. If the value of any Reset Field changes, the procedure refreshes the BrowseBox
list. Many BrowseBox events automatically refresh the list; however, if some want another control (such as a Radio button
or an entry field) or process to refresh the list, use a Reset Field.
Scroll Bar Behavior button
Pressing this button displays a dialog where you can define the way a scroll bar works.
Choose from Fixed Thumb or Movable Thumb.
For file loaded lists, you automatically get Standard Windows standard (movable thumb) scroll bar behavior. However,
since this is not possible for page loaded lists, these options let you choose the behavior that best suits your application.
Fixed Thumb
The thumb (square 3D box in the middle of the scroll bar) remains in the center of the scroll bar. CLICK above the thumb
to scroll up one "page." CLICK below the thumb to scroll down one "page." DRAG the thumb to the top or bottom of the
scroll bar to scroll the top or bottom of the file.
Choose Fixed Thumb when browsing large SQL tables to get best performance.
Movable Thumb
CLICK and DRAG the thumb to scroll a proportional distance in the list. The thumb remains where you drag it, and its
position on the scroll bar indicates the relative position within the browse list.
CLICK above the thumb to scroll up one "page." CLICK below the thumb to scroll down one "page".
96
Template Guide
When you choose Movable Thumb, you can also set the Key Distribution to further define how the BrowseBox
evaluates the thumb's relative position within the browse list.
Key Distribution
Specifies the distribution of the points of the scroll bar. Choose one of the two predefined distributions (Alpha or Last
Names), or Custom, or Run-time from the drop-down list.
Alpha
Defines 100 evenly distributed points alphabetically.
Last Names
Defines 100 points distributed as last names are commonly found in the United States. If the access key is numeric, you
should use a custom or run-time distribution.
Custom
Lets you define your own points.
Run-time
Reads the first and last record and computes the values for 100 evenly distributed points in between.
Custom Key Distribution
Lets you specify the break points for distribution along the scroll bar (useful when you have data with a skewed
distribution). Insert the values for each point in the list. String constants should be in single quotes ( ' ' ).
Run-time Distribution Parameters
Lets you specify the type of characters considered when determining the distribution points. This is only appropriate when
the Free Key Element is a STRING or CSTRING. Check the boxes for the types of characters you wish to include for
consideration. Choose from Use alpha characters (Aa-Zz), Use numeric characters (0-9), and Use other keyboard
characters.
Step Class Press this button to override the global Step Manager setting. See Classes Tab.
Conditional Behavior
This tab contains a list box that lets you define BrowseBox behavior based on conditions or expressions. Add expressions
to the list by pressing the Insert button. This displays a dialog where you define the expression and the associated
behavior when that expression evaluates to true (nonzero or non-blank).
At run-time the expressions are evaluated, and the behavior for the first true condition in the list is used.
In this dialog you can specify:
Condition Any valid Clarion expression. Press the "E" button to call the Expression
Editor. This dialog is used to help you construct syntactically correct
expressions to use in the Condition prompt.
Key to Use Optionally, the Key to use to sort the BrowseBox data when the
expression is true.
The remaining fields and buttons are the same as the Default Behavior tab.
Hot Fields
When you select the Hot Fields tab, you can specify fields not populated in the list to add to the QUEUE. When scrolling
through the file, the generated source code reads the data for these fields from the QUEUE, rather than from the disk.
This speeds up list box updates.
Specifying "Hot" fields also lets you place controls outside the BrowseBox that are updated whenever a different record is
selected in the list box. Elements of the Primary Key and the current key are always included in the QUEUE, so they do
not need to be inserted in the Hot Field list.
97
Template Guide
This dialog also lets you BIND a field. You must BIND any file field, variable, or EQUATE that is used in a filter
expression.
If the field you are BINDing does not need to be included in the default Browse VIEW structure, check the Not in View
checkbox.
Colors
This tab is only available if you check the Colors box in the List Box Formatter. It displays a list of the BrowseBox
columns that may be colored.
To specify the default colors and any conditional colors, highlight the column's field name, then press the Properties
button. This opens the Customize Colors dialog.
Use same color for all columns
Check this box if the color assignments designated here will be for all columns.
Customize Colors
This dialog is available if the Use same color for all columns check box is cleared, and lets you specify the default and
conditional Foreground and Background colors for normal (unselected) and selected columns.
Create Greenbar Effect
Check this box to allow two color sets to be used in an alternating row format. If this box is cleared, you can use the
Conditional Color Assignments dialog to specify any number of colored rows based on specified conditions.
Alternate columns
Only enabled when the Create Greenbar Effect check box is checked. Check this box to specify that the two color
pattern will be used to each column display in addition to each row (producing a checkerboard pattern).
Conditional Color Assignments
Below the default colors section is the Conditional Color Assignments list. This list lets you set colors to apply when an
expression evaluates to true (nonzero or non-blank). To add an expression and its associated colors, press the Insert
button.
At run-time the expressions are evaluated, and the colors for the first true expression are used.
Icons
This tab is only available if you check the Icons box in the List Box Formatter. It displays a list of the BrowseBox columns
which can display icons.
To specify default icons and any conditional icons, highlight the column's field name then press the Properties button.
This opens the Customize BrowseBox Icons dialog.
Customize BrowseBox Icons
This dialog lets you specify the default icon and conditional icons for the BrowseBox column.
Default Icon
The default icon to display. Type the icon (.ICO) filename.
You can also name a variable to use as the default icon, using the !variable format. The variable may be a string type that
stores the icon filename, or check the The expression is a number check box if you are referencing a previously named
icon assigned to the IconList property.
Conditional Icon Usage
Below the Default Icon section is the Conditional Icon Usage list. This list lets you set icons to apply when an
expression evaluates to true (nonzero or non-blank). To add an expression and its associated icon, press the Insert
button.
At run-time the expressions are evaluated, and the colors for the first true expression are used.
98
Template Guide
Styles
This tab is only available if you check the Style box in the List Box Formatter. It displays a list of the BrowseBox columns
that may have applied styles.
To specify the default styles and any conditional styles, highlight the column's field name, then press the
Properties button. This opens the Customize BrowseBox Styles dialog. A default style may also be defined on
the List Box Formatter Appearance tab.
Tooltips
This tab is only active if you check the Tooltip box in the List Box Formatter. It displays a list of the BrowseBox columns
which may have applied tool tips. Press the Properties button to display the Customize BrowseBox Tooltips dialog.
Tooltip variable
You can specify a default tool tip string value in the List Box Formatter. This entry lets you override the default tooltip to
use a value contained in a variable. Press the ellipsis button to select a variable that will contain the text of your column’s
tool tip.
99
Template Guide
Totaling
This tab contains a list box that lets you define total fields for a BrowseBox.
Always Calculate Totaling?
Check this box to always calculate browse totaling fields each time the browse box is refreshed. If this box is unchecked,
you can apply a condition to the calculation.
Condition
Enter a variable or expression on this line. If the variable or expression evaluates to a non-zero value, the browse totaling
loop will be executed, and all total values updated. Press the "E" button to call the Expression Editor. This dialog is used
to help you construct syntactically correct expressions to use in the Condition prompt.
Press the Insert button to add total fields. This opens the Browse Totaling dialog where you can define total fields for the
BrowseBox.
Total Target Field
The variable to store the calculated total. This can be a local, module, or global variable. You may also use a file field;
however, you must write the code to update the file.
Total Type
Choose Count, Sum, or Average from the drop-down list. Count tallies the number of records. Sum adds the values of
the Field to Total. Average determines the arithmetic mean of the Field to Total.
Field to Total
The field to sum or average. This box is disabled when the Total Type is Count. Press the "E" button to call the
Expression Editor. This dialog is used to help you construct syntactically correct expressions to use in the Field to Total
prompt.
Total Based On
Choose Each Record Read or Specified Condition from the drop-down list. This specifies whether to consider every
record or only those that meet the Total Condition criteria.
Total Condition
The condition to meet when using a Total based on a specified condition. You can use any valid Clarion expression. You
must BIND any file field, variable, or EQUATE that is used in a filter expression. The Hot Fields tab lets you BIND fields.
Press the "E" button to call the Expression Editor. This dialog is used to help you construct syntactically correct
expressions to use in the Total Condition prompt.
Extended Options
Do not include Primary key in view
Check this box to specify that primary key components are not projected into the view. This is useful when working with
SQL tables, and allows valid GROUP BY SQL statements to be generated. See also SQL Advanced Tab
Disable Browse Popup menu
Check this box to disable the popup menu for this Browse Box.
Enable Sort Header (ABC Template Chain Only)
Check this box to allow your list box header to determine the sort order of your list box.
At runtime:
Press CTRL + CLICK on a list header column to add that column to the sort.
100
Template Guide
Press SHIFT + CLICK on any list header column to remove all current sorts.
Removing all column sorts restores the list box to the default sort.
This option is compatible with the List Format Manager and the Auto-Size option discussed below.
This option is not valid with MEMO, BLOB or fields not defined in the browse VIEW structure.
101
Template Guide
Grouping
If you have enabled the Do not include Primary key in view option in the Browse controls’ Extended Options, the
following options are enabled.
Group
To add a GROUP BY clause to the template generated SQL statement, check this box and enter the appropriate SQL
string in the Grouping Definition field. Press the "E" button to call the Expression Editor. This dialog is used to help you
construct syntactically correct expressions to use in the Group prompt.
Having
To add a HAVING clause to the template generated SQL statement, check this box and enter the appropriate SQL string
in the Having Definition field. You must set a GROUP BY definition first to enable the HAVING clause. Press the "E"
button to call the Expression Editor. This dialog is used to help you construct syntactically correct expressions to use in
the Having prompt.
See GROUP BY and HAVING and VIEW support for aggregate functions for more information and examples.
Classes Tab
Use the Classes tab to override the global settings for the Class. See Classes Tab.
102
Template Guide
Template Prompts
The BrowseFuzzyMatching template provides the following prompts:
Display Match Results in Browse Check this box to display the match result
Listbox percentage in the Browse Listbox.
Display Match Results in Browse Check this box to display the match result
Listbox percentage in the Browse Listbox.
Last Column Populates the match result column as the last column .
in the Browse Listbox
103
Template Guide
Reset Fuzzy Match Result Order Check this box to reset the Browse Listbox
on Control Event? results from another control and event on
the window.
Global Options
From the Application Tree, press the Global button.
Select the General tab if it is not already selected.
The following prompts are available from the Global Options dialog, Enable Fuzzy Matching, and Fuzzy Matching
Options—Ignore Case and Word Only. See Template Overview—Global ABC Template Settings—General Tab Options.
104
Template Guide
BrowseGrid
The BrowseGrid template provides a group control that is used to define an area (within a BrowseBox) to display controls
in a matrix format. The size of the BrowseGrid control and BrowseBox can be manipulated to give the end result of a
matrix with one column or many. When this template is added, the BrowseBox control does not display at runtime.
This feature is particularly useful for Web applications, but can also extend the capabilities of desktop applications.
Requirements
This template requires a BrowseBox control template. The BrowseGrid GROUP box must be placed entirely within the
BrowseBox. If the application is to be a Web application, the WebGridExtension must be added to the procedures
extension set.
Populating the Control Template
Open the Window Designer for any procedure containing a BrowseBox control.
Select Populate Control Template. The Select Control Template dialog displays.
Highlight BrowseGrid and press the Select button.
Click on the window at the position where you want the Browse Grid.
If you have a multi-tab Browse, you do not want to populate the control template inside the TAB structure. Populating it
outside of the structure will enable it to display for all tabs.
Resize the BrowseGrid Group box, as desired. The size of the LIST and the size of the GROUP determine how many
columns will appear at runtime. The smaller the GROUP width, the more columns will be displayed at runtime.
This layout will produce a list with two columns and multiple rows (GROUP box ½ the size of the LIST box):
This next layout will produce a grid with one column and multiple rows:
Populate other controls you want to display for each record. Keep in mind that these are for display only unless you write
the code to update records.
Typically, you will populate STRING controls in a BrowseGrid GROUP. You may also want to populate a DynamicImage
control.
Template Prompts
The BrowseGrid template provides the following prompts:
Expression for Group Title
Specifies a string, variable, or runtime expression using EVALUATE to use as the title for the group box that outlines each
entry in the grid. To specify a variable here, precede the entry with an exclamation point (!). To specify a runtime
expression, precede the entry with an equal sign (=).
105
Template Guide
Press the "E" button to call the Expression Editor. This dialog is used to help you construct syntactically correct
expressions to use in the Expression for Group Title prompt.
Color of Selected Group
Specifies the color of the currently selected group in the BrowseGrid. Type in a valid color equate, hex color code, or
choose from the color dialog by pressing the ellipsis button.
If a color is specified in a Web application, the specific color used at runtime is taken from the web skeleton set.
Update on control event
Check this box to allow the Update Control use variable to update when the Update Control Event occurs.
Update Control
Specifies the control that will initiate the update.
Update Control Event
Specifies the event that triggers the update action.
Make Group Selectable
Check this box to indicate the group defined by the BrowseGrid can be selected and generate events.
Forward Other Control Clicks
Check this box to force an EVENT:Accepted action to the Forward Click To control when a cell in the matrix is selected.
A DOUBLE-CLICK activates the action in a Windows application.
Forward Other Control Clicks (To)
Specifies the control to process when a cell in the BrowseGrid matrix is selected.
BrowsePrintButton
The BrowsePrintButton template provides a Print button to call a procedure with the ProcessRecord request (see
Procedure Templates--Inter-Procedure Communication for more information).
Print All Items
If you use the BrowsePrintButton to call a simple Report procedure, the report prints as usual, applying any design-time
keys, sort orders, range-limits, and filters.
Print the Selected Item
If you use the BrowsePrintButton to call a Report procedure with the ExtendProgressWindow extension template (set to
Single record), the report reacts to the ProcessRecord request and processes only the selected BrowseBox item. See
Other Templates--ExtendProgressWindow for more information.
This option works by using a current-value limit on the report key. Therefore, if you have a non-unique key you can print
multiple items--for example, all customers named Smith.
The BrowsePrintButton template provides the following prompts:
Procedure name
Type the name of a procedure to call or select a procedure from the drop-down list.
106
Template Guide
BrowsePublishButton (BrowseToHTML)
The BrowsePublishButton template provides a Publish button to generate the Hypertext Markup Language (HTML) to
display records from a BrowseBox queue. In other words, use this template to publish your BrowseBox information to an
Internet Web page!
The BrowsePublishButton template is only available in the Clarion template chain and cannot be used with the ABC
Templates.
The resulting Web page displays a headline that you specify, plus the headers from your list box. The Web page formats
the list box data using the picture tokens specified in the list box.
At runtime, the user may specify the filename for the generated HTML. Also, the user has the option to publish all the
items in the BrowseBox queue or just the items currently displayed on the screen.
The BrowsePublishButton template provides the following prompts:
107
Template Guide
108
Template Guide
The Browse QBEList Control Template is a special control template that allows you to test table queries easily and view
the results. You can drag columns from a browse box into the query area, enter values, and quickly test your data set.
This template requires that a Browse Box be populated on the window. Although there are no special prompts associated
with this template, there are multiple controls that are populated together and are described below:
You can also drag a column name from the browse box to this list box.
You can also drag specific value from a selected row of the browse. For example, if you select the Column Name and
drag from a row where the value of that column is "Bob", the QBE List will use that column/value to create Name = 'Bob'.
In the Value or Expression line, do not enter a single quote in your search string. Instead, if you wish to search for ‘FL’ as
your search string, enter ‘’FL’’.
You can query fields with NULL values on SQL tables using the QBEList by entering the following in the Value line:
<NULL>
Updates to the browse box forces an automatic refresh of the active query.
Reset Button
Clears the list box for a new query.
109
Template Guide
Storage is automatic with ABC templates, but you must specify a storage source in the Global Properties of your
application when using the Clarion template chain.
Save As Button
Saves the query to a new name that you specify from a query previously loaded.
Apply Button
Executes the current active query.
The operator names that are used with the Query Center are stored externally in a translation file named Cfilterlist.trn
found in \LIBSRC folder. What this means is that the default list of operators (EQUAL, CONTAINS, BETWEEN, etc.) can
now be customized outside of the program code in this translation file. The file cFilterList.TRN defines a group with the
following format:
DefaultOpe GROUP
Number USHORT(20)
PSTRING('Equal')
PSTRING('Equal')
ULONG
[...]
END
The first PSTRING is what the user will see in the Query Center. The second PSTRING is the operator that the source
code will use internally. The ULONG represents a bit mapped value that will indicate to the source code what data type
will be valid with the operator (not implemented in this release). The first Number in the group is just telling the Query
Center how many repetitions are present in the group. In our example above, there are currently 20 operators available in
the translation file.
This translation file serves two purposes. It allows for variations in what the end users see for spoken language
translations, and provides the ability to add "natural language" queries.
For more detailed information regarding the translation file, see the Query Center Translation File topic.
110
Template Guide
111
Template Guide
BrowseToolboxButton
The BrowseToolboxButton template provides a Toolbox button. Pressing the button starts a floating, dockable toolbox
containing buttons that invoke the BrowseBox actions defined by the BrowseBox popup menu (Insert, Change, Delete,
Select, Print, etc.).
The BrowseBox template automaically adds the Toolbox choice to its popup menu; therefore you can HIDE the Toolbox
button but still provide access to the toolbox with the popup menu.
The BrowseToolboxButton template provides no configuration prompts.
The standard Toolbox behavior is defined by the ABC Library's PopupClass. See PopupClass in the ABC Library
Reference for more information.
BrowseToolbarControl
The BrowseToolbarControl template places thirteen (13) standard command buttons on the window. When the user
presses these buttons, the template generated code posts appropriate events (scroll up, scroll down, add, change, delete,
help, etc.) to the various Browse controls. This template requires a BrowseBox control. See Control Templates –
FrameBrowseControl for detailed information on each of the thirteen button controls.
Classes
The classes tab lets you control the class (and object) the template uses. You may accept the default Application Builder
Class and it's object (reccomended) or you may specify your own or a third party class. Deriving your own class can give
you very fine control over the procedure when the standard Application Builder Class is not precisely what you need.
See Template Overview – Classes Tab Options – Local for complete information on these options.
112
Template Guide
Edit-in-Place
Use Edit in place
Check this box to let the end user update the browsed file by typing directly into the BrowseBox list. This provides a very
direct, intuitive spreadsheet style of update. You may configure the Edit in place behavior with the Configure Edit in
place button.
The Detailed Interface of the Browse EIP manager now enables an expanded variety of control types to be used with Edit
In Place without the need to embed hand code.
In order to invoke the new EIP manager, go to Global Properties and select the Classes Tab. Click on the Browser
button, and click on the EIP tab control. A Template Interface prompt has been added to the dialog on the EIP tab. From
the drop down associated with that entry, select Detailed. If your application had previously existing hand code, these
embeds will be archived as Orphaned.
113
Template Guide
Remain editing
The Configure Edit in place dialog offers the Remain editing option for three different keyboard actions. Check these
boxes to continue editing upon the following keyboard actions: TAB key at end of row, ENTER key, up or down arrow key.
Clear the boxes to stop editing.
Retain column
The Configure Edit in place dialog offers the Retain column option for the up and down arrow keys only. Check this box
to continue editing within the same list box column in the new row. Clear to continue editing within the left most editable
column in the new row.
Insertion Point
The Configure Edit in place dialog offers the Insertion Point option for initial new record placement in the list. The
droplist choices— before, after, and append— indicate where the edit-in-place row will appear in the list when inserting a
record. Before and after indicate placement in relation to the highlighted record, and append places the edit-in-place row
at bottom of the list.
This does not change the sort order. After insertion, the list is resorted and the new record appears in the proper position
within the sort sequence.
Action on Delete
The Configure Edit in place dialog offers the Action on delete option when a record deletion is attempted during edit-in-
place. Select Prompted from the drop list if you wish the user to be prompted with a confirm delete message prior to
deletion. Select Never if you do not want to allow record deletions from an edit-in-place. Finally, select Always if you want
to allow users to delete records during edit-in-place, and the deletion is automatic (no confirm message).
Field Priming on Insert
Press this button to access the Field Priming dialog window. Field Priming lets you provide a default value for fields in a
new record. This value supersedes any initial value specified in the data dictionary. You can select a field and set an initial
value in the Field Priming dialog.
In Original EIP mode, press the ellipsis button to select a Field to add to the EIP controls. Check the Allow Edit-In-Place
box to allow edit-in-place for the selected control. After selecting a field, the Class Definition group is then enabled.
114
Template Guide
In both modes, the Column Specific dialog lets you control the class (and object) the procedure uses to edit a specific
Browsebox column. You may specify your own or a third party class.
By default, the BrowseUpdateButton template generates code to use the EditEntryClass in the ABC Library. The Global
Edit in place (EIP) class must have the EditEntryClass specified as the base class. You can also use the other edit
classes or derive your own.
The Application Generator must know about the CLASS you specify--see the Template Overview--ABC Compliant
Classes section in the Template Language Reference for more information. See also Classes Tab.
Column Specific Dialog: General Sub Tab Prompts
This tab and its associated prompts are only available when the Global EIP Configuration is set to Detailed.
Allow Edit-In-Place
Check this box to allow edit-in-place for the selected control.
Type
Select from 13 types of window and dialog controls. Each control and dialog support has specific prompts that are
applicable to that specific type.
The type control triggers the appropriate EIP class implementation, and options set the properties necessary for that class
object. For more information, see the EditClass and other supporting classes in the ABC Library Reference.
It is also important to know that the DropList and DropCombo type controls used for EIP are manual controls (not control
templates), and will need to have their list queues manually defined and populated to ensure their successful use.
The MultiSelect type includes a MultiSelect Options button where the following additional options are available:
Data Source
Choose from Fixed or Queue. This designates if the multiselect list box will be loaded from a hard coded (fixed) set of
values, or from a queue that can be dynamically built and modified at runtime.
The Fixed option contains an option to designate an item as auto-selected. Click on the Selected check box to enable this
option. This option is ignored if the Auto Serialize Field option is enabled.
Auto Serialize Field
Check this box if you would like the template to auto-populate the target EIP column with selected items in the MultiSelect
dialog. If you do not enable this option, you will have to manually process the selected elements using the
TakeCompletedProcess embed point. See the ABC Library Reference for more information.
Field Delimiter
Specify the delimiter to use between selected items. This prompt is required if you choose to auto serialize. Enter the
delimiter without single quotes. A "space" delimiter cannot be used here.
115
Template Guide
BrowseViewButton
The BrowseViewButton template provides a View button that calls the browse update procedure without update
functionality (view only). This allows the end user an opportunity to look at a record and its associated child records via
the update procedure while not permitting updates to the record.
This template adds a View button and the underlying code to call the update procedure. The code sets GlobalRequest to
ViewRecord. The BrowseViewButton template requires an instance of a BrowseBox template, and the Browse Update
Buttons. If you wish your browse to only have View Only capablilities, you can simply delete the update buttons.
The BrowseViewButton template provides no additional template prompts, but adds standard embed points for the View
BUTTON.
The Calendar Button Control Template is a button control that, when pressed, displays a full-feature calendar. A date
value is returned to a targeted entry control. There are simple options to control the calendar title, extent of display
features, and refresh window options.
116
Template Guide
The Calendar Button Control Template is a button control that, when pressed, displays a full-feature calendar. A date
value is returned to a targeted control. There are simple options to control the calendar title, extent of display features,
and refresh window options.
Control
Select the associated ENTRY control for which to send the date value you selected on the calendar control.
Calendar Title
Enter a string value that you wish to use as the title of your calendar control.
Refresh Window
Check this box to force a refresh of the window controls when returning to the calling procedure.
117
Template Guide
Many of the ABC Procedure, Control and Extension templates provide a Classes tab or dialog. These local Classes tabs
let you control the classes (and objects) your procedure uses to accomplish the template's task—that is, they override the
global class settings specified in the Global Properties dialog. You may accept the default Application Builder Class
specified in the Global Properties dialog (recommended), or you may specify your own or a third party class to override
the default setting. Deriving your own class can give you very fine control over the procedure when the standard
Application Builder Class is not precisely what you need.
Click here to view the Global Calendar Configuration dialog.
Clarion provides you with three types of Calendar Classes that you may use with the CalendarButton control template, or,
in hand coded projects if needed.
CalendarClass
The CalendarClass displays a simple and functional calendar that was designed to be compatible with the Windows XP
look.
118
Template Guide
CalendarSmallClass
The CalendarSmallClass displays a calendar that is more compatible with other non-XP style environments:
CalendarBaseClass
The default source code for the CalendarBaseClass is located in the ABUTIL.CLW file (located in the LIBSRC directory).
You must include the default window and corresponding source code in the respective DATA and CODE sections of the
CalendarBaseClass derived ASK method. User interface structures and controls for popup calendar are located in
ABUTILUI.INC.
119
Template Guide
When Pressed The standard set of prompts for buttons Normally, when using a Control
template, these prompts are not used.
When Pressed The standard set of prompts for buttons Normally, when using a Control
template, these prompts are not used.
120
Template Guide
The DOSFileLookup template adds an ellipsis (...) button which opens the standard Windows file dialog.
You can specify the file masks, the default directory and filename, and the variable to receive the filename selected by the
end user.
In addition, you may optionally allow the selection of multiple files and specify the code to process each selected file. The
template generates a LOOP to process all the selected files.
Another new feature supported is the ability to assign the filename selected directly to an IMAGE control.
The DOSFileLookup template provides the following prompts:
General
File Dialog Header Type the text for the caption of the Windows file dialog.
DOS Filename Press the ellipsis (...) button to choose a variable to receive the end
Variable user's choice from the Select Column dialog. You can also type the
variable name directly into the entry box.
Default Directory Specify the starting directory for the Windows file dialog. If blank, the file
dialog opens to the working directory. If you want to use a variable for
the pathname, then you must preface it with an exclamation point
(Example: !Myvariable).
Default Filename Specify the initial filename for the Windows file dialog. If blank, the file
dialog opens with no initial filename.
Return to original Check this box to reset the working directory to its value prior to the file
directory when lookup.
done
Long Filenames? Check this box to enable the Windows file dialog to allow the selection of
files with long filenames.
Dialog Type Select the type of dialog that you want to present to the user. Open
allows a user to simply access a file name from the Open dialog. Save
allows the user to update the contents of the filename selected. Directory
allows the user to return the path only (no filename) as presented by the
Windows dialog.
Don’t Report Check this box to allow errors to be reported if a file name could not be
Errors opened or saved.
Return Default on Check this box to automatically return the default directory or filename
Cancel value if the user presses the Cancel button in the appropriate dialog
window.
Action For Each Type a valid Clarion language statement to execute for each selected
Selection file--typically a procedure call. You may want to pass the FileName
Variable as a parameter to the procedure.
121
Template Guide
The template generates a LOOP to execute the code you specify for
each selected file. The generated code reloads the FileName Variable
with the appropriate filename for each loop cycle.
Assign to Image Check this box if you wish to assign the selected filename’s contents to
Control an image control. Use the Image Control drop list to select the image
control’s Field Equate Label.
Resize to control Check this box to designate that the filename’s contents assigned to the
size target Image control will be resized to fit the control.
Set Default Mask Press this button to set the default file masks to use when selecting a
Value valid image file to load into the target image control.
File Masks
Use a variable file Check this box to supply the file mask with a variable. This enables the
mask Variable Mask Value field to name the variable, and disables the Mask
Description, File Mask, and More File Masks prompts.
Mask Variable Names the variable that contains the file mask. See FILEDIALOG in the
Language Reference for information on the contents of this variable.
File Mask Type a file type description. The string appears in the drop-down list in
Description the Windows file dialog. You can add additional masks by pressing the
More File Masks button.
File Mask Type a file mask specification, such as "*.TXT" or use multiple patterns
for this mask separating each with a semicolon, such as "*.BMP;*.GIF".
You can add additional masks by pressing the More File Masks button.
More File Masks Press this button to add additional file masks. These masks are available
to end the user through the List files of type drop-down list in the
Windows file dialog.
Update entire Check this box to refresh the contents of all window controls after the file
window? selection and processing is complete. Clear the box to select specific
fields to refresh.
Update Selected Press this button to select specific fields to refresh after the file selection
Fields and processing is complete. The template generates a DISPLAY
statement for each field you specify. See DISPLAY in the Language
Reference.
Classes Tab
Use the Classes tab to override the global settings for the Class. See Classes Tab.
122
Template Guide
DynamicImage
The DynamicImage control provides an image control that must be placed within an existing BrowseGrid control. This
template provides the BrowseGrid with the correct image associated with the column specified by the Field to drive image
prompt. The image is a clickable image that can perform an action associated with any control on the window. The
DynamicImage control requires a BrowseGrid control.
The DynamicImage template provides the following prompts:
Field to drive Specifies the column from the table that designates the image file name.
image
Classes
The classes tab lets you control the class (and object) the template uses. You may accept the default Application Builder
Class and it's object (recommended) or you may specify your own or a third party class. Deriving your own class can give
you very fine control over the procedure when the standard Application Builder Class is not precisely what you need.
Control with Select the associated control for which to perform the lookup by
Lookup choosing its field equate label from the drop-down list. Typically this is an
ENTRY control.
123
Template Guide
The FileDrop template places a file-loaded scrollable drop-down list on a window. At runtime, the end user can select an
item from the list, then assign a value from the selected item's record to a specified target field. You may display one field
(such as a description field) but assign another field (such as a code field) from the selected record (see Using drop-down
lists to Lookup Records).
Set the DROP attribute to zero (0) to display a list box rather than a drop-down list.
Immediately before you place the FileDrop Control template on your window, the Application Generator prompts you to
specify the file to display in the drop-down list. Specify the file in the Select Field dialog. You will also need to select a
field to serve as the USE variable for the LIST; however, the field you select is only significant if you are displaying one
field but assigning another).
Immediately after you place the FileDrop Control template, the Application Generator opens the List Box Formatter so you
can specify the fields to display in your list. You may specify the field containing the lookup value as well as other fields
from the same or related files.
After you specify your list fields and return to the window under construction, right-click the control, then choose Actions
from the popup menu to complete the following FileDrop options:
General
Table Schematic Enter a descriptive string that will be displayed in the Table Schematic
Description window for this particular control. This allows you to distinguish one
control from another when there are multiple controls populated in a
single window.
Field to Fill From The field in the lookup file whose value is assigned to the Target Field.
Press the ellipsis (...) button to select from the Select Field dialog.
Target Field The field that receives the value from the Field to Fill From. Press the
ellipsis (...) button to select from the Select Field dialog.
More Field Press this button to specify additional value assignments from the
Assignments selected item's record.
Record Filter Type a valid Clarion expression to limit the contents of the list to only
those records causing the expression to evaluate to true (nonzero or
non-blank). The procedure loops through all displayable records to select
only those that meet the filter. Filters are generally much slower than
Range Limits.
124
Template Guide
Press the E button to call the Expression Editor. This dialog is used to
help you construct syntactically correct expressions to use in the
appropriate prompts.
You must BIND any file field, variable, or EQUATE that is used in a filter
expression. The Hot Fields tab lets you BIND fields.
Default to first Check this box to provide an initial default selection--the drop-down list is
entry if USE never initially empty (unless the first file record is a blank one).
variable empty
IPDRV Options
Do not include Check this box to specify that primary key components are not projected
Primary key in view into the view. This is useful when working with SQL tables, and allows
valid GROUP BY SQL statements to be generated. See also SQL
Advanced Tab
Range Limits
This tab is only available if you specify a Key for the File in the Data / Tables Pad dialog. Because range limits use keys,
they are generally much faster than filters.
Range Limit Field In conjunction with the Range Limit Type, specifies a record or group
of records for inclusion in the process. Choose a key field on which to
limit the records by pressing the ellipsis (...) button.
Range Limit Type Specifies the type of range limit to apply. Choose one of the following
from the drop-down list.
Single Value Lets you limit the key field to a single value. Specify the variable
containing that value in the Range Limit Value box.
Range of Values Lets you limit the key field to a range of values. Specify the variables
containing the upper and lower limits of the range in the Low Limit
Value and High Limit Value boxes.
File Relationship Lets you limit the key field to the current value in a related (parent) file.
Press the Related file ellipsis (...) button to choose the range limiting
file. This limits the process to include only those child records
matching the current record in the parent file. For example, if your
report was a list of Orders, you could limit the process to only those
orders for the current Customer.
Colors
This tab is only available if you check the Color Cells box in the List Box Formatter. It displays a list of the FileDrop
columns which may be colored.
To specify the default colors and any conditional colors, highlight the column's field name, then press the Properties
button. This opens the Customize Colors dialog.
125
Template Guide
Customize Colors This dialog lets you specify the default and conditional Foreground and
Background colors for normal (unselected) rows; and for selected rows.
Conditional Color Below the default colors section is the Conditional Color Assignments
Assignments list. This list lets you set colors to apply when an expression evaluates to
true (nonzero or non-blank). To add an expression and its associated
colors, press the Insert button.
Press the E button to call the Expression Editor. This dialog is used to
help you construct syntactically correct expressions to use in the
appropriate prompts.
At run-time the expressions are evaluated, and the colors for the first true
expression are used.
Icons
This tab is only available if you check the Icons box in the List Box Formatter. It displays a list of the FileDrop columns
which can display icons.
To specify default icons and any conditional icons, highlight the column's field name then press the Properties button.
This opens the Customize Icons dialog.
Customize Icons This dialog lets you specify the default icon and conditional icons for the
FileDrop column.
Default Icon The default icon to display. Type the icon (.ICO) filename. You can also
name a variable to use as the default icon, using the !variable format.
The variable may be a string type that stores the icon filename, or check
the The expression is a number check box if you are referencing a
previously named icon assigned to the IconList property.
Conditional Icon Below the Default Icon section is the Conditional Icon Usage list. This
Usage list lets you set icons to apply when an expression evaluates to true
(nonzero or non-blank). To add an expression and its associated icon,
press the Insert button.
Press the E button to call the Expression Editor. This dialog is used to
help you construct syntactically correct expressions to use in the
appropriate prompt.
At run-time the expressions are evaluated, and the colors for the first true
expression are used.
Styles
This tab is only available if you check the Style box in the List Box Formatter. It displays a list of the List Box columns that
may have applied styles.
To specify the default styles and any conditional styles, highlight the column's field name, then press the Properties
button. This opens the Customize List Box Styles dialog. A default style may also be defined on the List Box Formatter
Appearance tab.
126
Template Guide
Create GreenBar Effect Check this box to create a GreenBar effect (alternating colors
on each row) on your list box. You will be prompted to select
two styles to use that represent the appearance of each
alternating row
Default Style This entry lets you specify the default style to be used for the
column.
Conditional Styles This list lets you define the styles to apply when an expression
evaluates to true (nonzero or non-blank). To add an expression
and its associated colors, press the Insert button.
Press the E button to call the Expression Editor. This dialog is used
to help you construct syntactically correct expressions to use in the
appropriate prompt.
Style Define the style number that will be applied to the column when the
Condition evaluates to true (nonzero or non-blank).
At run-time the expressions are evaluated, and the styles for the first true expression are used.
All Styles must be defined. For more information on defining styles see FORMAT (set LIST or Combo layout).
Tooltips
This tab is only active if you check the Tooltip box in the List Box Formatter. It displays a list of the List Box columns
which may have applied tool tips. Press the Properties button to display the Customize BrowseBox Tooltips
dialog.
Tooltip variable
You can specify a default tool tip string value in the List Box Formatter. This entry lets you override the default tooltip to
use a value contained in a variable. Press the ellipsis button to select a variable that will contain the text of your
column’s tool tip.
Hot Fields
When you select the Hot Fields tab, you can specify fields not populated in the list to add to the QUEUE. When scrolling
through the file, the generated source code reads the data for these fields from the QUEUE, rather than from the disk.
This speeds up list box updates.
Specifying "Hot" fields also lets you place controls outside the FileDrop that are updated whenever a different record is
selected in the list box. Elements of the Primary Key and the current key are always included in the QUEUE, so they do
not need to be inserted in the Hot Field list.
This dialog also lets you BIND a field. You must BIND any field, variable, or EQUATE that is used in a filter expression or
as a field to total. If the field you are BINDing is not in the VIEW, check the Not in View checkbox.
Sort Fields
This tab lets you add fields by which the items in the drop-down list are sorted. The sort fields are in addition to any Key
specified for the FileDropCombo. Press the Insert button to add fields to the list.
Classes Tab
Use the Classes tab to override the global settings for the Class.
127
Template Guide
Other Prompts
The List Properties for this control are the same as for a list; however, the following prompts may require some additional
explanation:
Use Takes either a field equate label, or the label of a variable to receive the
value from the first field populated in the list. In the FileDrop Control
template context, this functionality is replaced by the more flexible Target
Field setting.
Mark Takes the label of the Queue:FileDrop:Mark QUEUE field to allow the
user to select more than one item from the list. The
Queue:FileDrop:Mark field contains 1 for selected items and 0 for
unselected items.
128
Template Guide
The FileDropCombo template generates code to display a data file in a scrollable list, select one of the records from the
list, then assign a value from the selected record to a specified target field. Note that you may display one field (such as a
description field) but assign another field (such as a code field) from the selected record (see Using drop-down lists to
Lookup Records ). Also, because the template is based on a COMBO control, the generated code accepts entry values
that may not exist in the displayed list and optionally adds these new values to the lookup file.
Immediately before you place the FileDropCombo Control template on your window, the Application Generator prompts
you to specify the file to display in the drop-down list. Specify the file in the Select Field dialog. You will also need to
select a field from the file to serve as the USE variable for the COMBO. The USE variable is significant when you Allow
Updates from the FileDropCombo or when you display one field but assign another.
Immediately after you place the FileDropCombo Control template, the Application Generator opens the List Box Formatter
so you can specify the fields to display in your list. You may specify the field containing the lookup value as well as other
fields with associated information.
After you specify your list fields and return to the window under construction, RIGHT-CLICK the control, then choose
Actions from the popup menu to complete the following FileDropCombo options:
General
Table Schematic Enter a descriptive string that will be displayed in the Table Schematic
Description window for this particular control. This allows you to distinguish one
control from another when there are multiple controls populated in a
single window.
Field to Fill From The field in the lookup file whose value is assigned to the Target Field.
Press the ellipsis (...) button to select from the Select Field dialog.
Target Field The field that receives the value from the Field to Fill From. Press the
ellipsis (...) button to select from the Select Field dialog.
More Field Press this button to specify additional value assignments from the
Assignments selected item's record.
Record Filter Type a valid Clarion expression to limit the contents of the list to only
those records causing the expression to evaluate to true (nonzero or
non-blank). The procedure loops through all displayable records to select
only those that meet the filter. Filters are generally much slower than
Range Limits.
You must BIND any file field, variable, or EQUATE that is used in a filter
expression. The Hot Fields tab lets you BIND fields.
Default to first Check this box to provide an initial default selection--the drop-down list is
entry if USE never initially empty (unless the first file record is a blank one).
variable empty
129
Template Guide
IPDRV Options Press this button if you are using the IP Driver in your application, and
need to adjust the default settings in the IPDRV Options dialog.
Do not include Check this box to specify that primary key components are not projected
Primary key in into the view. This is useful when working with SQL tables, and allows
view valid GROUP BY SQL statements to be generated.
Remove duplicate Check this box to remove duplicates from the list.
entries
Keep View Check this box to update the VIEWs record buffers to match the selected
synchronized with item.
Selection?
Automatic Entry Check this box to allow the entry control to act as a incremental locator.
Field Completion As you enter characters, the template locates and populates the closest
matching record in the list box (equal to or greater than the current entry
field’s contents).
Case Sensitive Check this box to consider case when matching entered values with
matches? values in the lookup file.
Range Limits
This tab is only available if you specify a Key for the File in the Data / Tables Pad dialog. Because range limits use keys,
they are generally much faster than filters.
Range Limit Field
In conjunction with the Range Limit Type, specifies a record or group of records for inclusion in the process. Choose a
key field on which to limit the records by pressing the ellipsis (...) button.
Range Limit Type
Specifies the type of range limit to apply. Choose one of the following from the drop-down list.
Current Value
Limits the key field to its current value.
Single Value
Lets you limit the key field to a single value. Specify the variable containing that value in the Range Limit Value box.
Range of Values
Lets you limit the key field to a range of values. Specify the variables containing the upper and lower limits of the range in
the Low Limit Value and High Limit Value boxes.
File Relationship
Lets you limit the key field to the current value in a related (parent) file. Press the Related file ellipsis (...) button to choose
the range limiting file. This limits the process to include only those child records matching the current record in the parent
file. For example, if your report was a list of Orders, you could limit the process to only those orders for the current
Customer.
Colors
This tab is only available if you check the Color Cells box in the List Box Formatter. It displays a list of the
FileDropCombo columns which may be colored.
To specify the default colors and any conditional colors, highlight the column's field name, then press the Properties
button. This opens the Customize Colors dialog.
130
Template Guide
Customize Colors
This dialog lets you specify the default and conditional Foreground and Background colors for normal (unselected) rows;
and for selected rows.
Conditional Color Assignments
Below the default colors section is the Conditional Color Assignments list. This list lets you set colors to apply when an
expression evaluates to true (nonzero or non-blank). To add an expression and its associated colors, press the Insert
button.
At run-time the expressions are evaluated, and the colors for the first true expression are used.
Icons
This tab is only available if you check the Icons box in the List Box Formatter. It displays a list of the FileDropCombo
columns which can display icons.
You can also name a variable to use as the default icon, using the !variable format. The variable may be a string type that
stores the icon filename, or check the The expression is a number check box if you are referencing a previously named
icon assigned to the IconList property.
To specify default icons and any conditional icons, highlight the column's field name then press the Properties button.
This opens the Customize Icons dialog.
Customize Icons
This dialog lets you specify the default icon and conditional icons for the FileDropCombo column.
Default Icon
The default icon to display. Type the icon (.ICO) filename. To specify a variable icon name, prefix the variable name with
an exclamation point (i.e., !MyIconVariable)
To specify the default styles and any conditional styles, highlight the column's field name, then press the Properties
button. This opens the Customize List Box Styles dialog. A default style may also be defined on the List Box Formatter
Appearance tab.
131
Template Guide
Condition
Provide a valid Clarion expression that when evaluates to true (nonzero or non-blank) will cause the Style to be applied.
Style
Define the style number that will be applied to the column when the Condition evaluates to true (nonzero or non-blank).
At run-time the expressions are evaluated, and the styles for the first true expression are used.
All Styles must be defined. For more information on defining styles see FORMAT (set LIST or Combo layout).
Tooltips
This tab is only active if you check the Tooltip box in the List Box Formatter. It displays a list of the List Box columns
which may have applied tool tips. Press the Properties button to display the Customize BrowseBox Tooltips
dialog.
Tooltip variable
You can specify a default tool tip string value in the List Box Formatter. This entry lets you override the default tooltip to
use a value contained in a variable. Press the ellipsis button to select a variable that will contain the text of your
column’s tool tip.
Update Behavior
This tab lets you use the entry portion of the COMBO to initiate adding a new record to the lookup file. If the user types a
value in the entry box that is not already in the list, the generated code can add a new record directly, or it can call a
separate procedure to add the new entry.
Allow Updates Clear this box to only allow items in the drop list to be entered as as valid
entry. Values not matching the target field in the drop list will be automatically
cleared.
Check this box to add new entries to the lookup file, and to enable the
Update Procedure prompt. If the Update Procedure prompt is left blank, an
entry not in the drop list will pop up a window that contains the following
message:
If you press the "Yes" button, the new value will be accepted, and added to
the lookup file. If you press the "No" button, the entry will be cleared and not
added to the lookup file.
If you wish to allow unvalidated entries (entries NOT contained in the lookup file), use a standard File Combo control.
Update Procedure Name the procedure to call to add the new record, or leave this field
blank if no update procedure is needed.
No update procedure is needed for lookup files with only one required
field (the field specified by the COMBO's USE variable). Non-USE fields
are CLEARed, unless range limited or auto-incremented.
132
Template Guide
Silent Automatic This option is used is you wish to allow "silent adds" to the drop combo
Add list box, without confirmation or display of an update procedure. This
option is only enabled if you have checked the Allow Updates box, but
have not entered an Update Procedure.
Hot Fields
Use the Hot Fields tab to specify fields to add to the QUEUE that are not displayed in the list. When scrolling through the
file, the generated source code reads the data for these fields from the QUEUE, rather than from the disk. This speeds up
list box updates.
Specifying Hot Fields effectively lets you update other controls whenever a new record is selected in the list box.
Elements of the Primary Key and the current key are always included in the QUEUE, so they do not need to be inserted in
the Hot Field list.
Press the Insert button to add fields to the list.
If the field you are BINDing is not in the VIEW, check the Not in View checkbox.
Sort Fields
This tab lets you add fields by which the items in the drop-down list are sorted. The sort fields are in addition to any Key
specified for the FileDropCombo. Press the Insert button to add fields to the list.
Classes Tab
Use the Classes tab to override the global settings for the Class. See Classes Tab.
Other Prompts
The List Properties for this control are the same as for a list; however, the following prompts may require some additional
explanation:
Use Takes either a field equate label or the label of a variable to receive the value from
the first field populated in the list. In the FileDropCombo Control template context,
the assignment functionality is replaced by the more flexible Target Field; however,
the USE variable is significant when you Allow Updates from the FileDropCombo
(see Update Behavior for more information).
Mark Takes the label of the Queue:FileDropCombo:Mark QUEUE field to allow the user
to select more than one item from the list. The Queue:FileDropCombo:Mark field
contains 1 for selected items and 0 for unselected items.
133
Template Guide
The FormVCRButtons Control Template is used to navigate to different records (or rows) from a single Form window. If
desired, you can also perform standard database operations on selected records. It is designed as an alternative to the
standard Browse-Form paradigm.
This template is an alternative replacement of the browse that is used to call a Form. Currently this template is only
available in the ABC template chain.
The Form VCR buttons control template provides the following functions:
Navigation:
Go to the Next Record Page Down to the Record Go to the Last Record
Actions:
Switch the form to Recursive Add Mode. The OK button on the form saves the record
and allows you to insert another. The Cancel button cancels the operation and returns to
the calling procedure.
Switch the form to change mode. The OK button on the form saves the record and
allows you to navigate to another record. The Cancel button cancels the operation and
returns to the calling procedure.
134
Template Guide
Switch the form to delete mode. The OK button on the form saves the record and allows
you to navigate to another record. The Cancel button cancels the operation and returns
to the calling procedure.
To make this control template active (or visible) to the Form procedure, you must have a Save Button control template
populated.
The FormVCRButtons template is designed to merge the standard functionality of the Browse Box template with a
standard form. Moreover, it is actually designed as an alternative to the Browse-Form paradigm (e.g., calling a form from
a menu).
In addition to these functions, the FormVCRButtons template provides these additional prompts:
Default Action
Select from the drop list the default mode to set when the Form window is first opened.
Do not include Primary key in view
Check this box to specify that primary key components are not projected into the view. This is useful when working with
SQL tables, and allows valid GROUP BY SQL statements to be generated.
Change to Insert mode if table is empty
Check this box to switch the default behavior to Insert if the primary file specified by the update procedure is empty. The
only reason that you would not check this box is the case where Inserts are not allowed on the Form.
Page Size
Enter a number (manually or with the spin control) to designate how many records you wish to Page Up and Down when
navigating. The default value is 10.
If you need to restrict a particular action supported by the FormVCRButtons (i.e., Insert, Change, Delete) you can simply
delete the appropriate button.
In order to enable locator activity with the FormVCRButtons template, you must specify a key for the Form’s primary file.
The default behavior for this template is the same as a standard Browse Box. For more help on the other Default Behavior
prompts (Locators, Range Limit, Record Filters, etc.), see Browse Box - Default Behavior
The Conditional Behavior prompts of the FormVCRButtons control template are identical to the Browse Box conditional
behavior. See Browse Box - Conditional Behavior.
135
Template Guide
The Hot Fields prompts of the FormVCRButtons control template are identical to the Browse Box Hot Fields. See Browse
Box - Hot Fields.
FormVCRButtons – Classes
The Classes prompts of the FormVCRButtons control template are identical to the Browse Box Classes options. See See
Classes Tab.
136
Template Guide
FrameBrowseControl
The FrameBrowseControl places thirteen (13) standard command buttons on the toolbar of an MDI APPLICATION
(Frame). When the user presses these buttons, the template generated code posts appropriate events (scroll up, scroll
down, add, change, delete, help, etc.) to the active procedure.
You may delete buttons that your application does not use. For example, the standard templates by default do not use the
locate button.
The buttons are designed to work with the BrowseBox Control template, the RelationTree Control template, and the
FormVCRControls Extension template; that is, the buttons remain disabled until the program calls a procedure with a
BrowseBox template or a RelationTree template whose Accept browse control from Toolbar box is checked, or the
BrowseBox procedure calls a Form procedure with a FormVCRControls extension template.
In addition, the called procedure's WINDOW must have the MDI attribute--the standard Browse and Form templates
declare MDI windows by default--you don't need to do anything special to accomplish this. The BrowseBox and
RelationTree templates also checks the Accept browse control from Toolbar box by default--so again, you don't need
to do anything special to accomplish this.
The FrameBrowseControl toolbar buttons operate as follows:
Scrolls up one row in the BrowseBox or to the previous record on any level in
a RelationTree. For Form procedures, saves the current record before
scrolling.
Scrolls down one row in the BrowseBox or to the next record on any level in a
RelationTree, expanding the tree branch if necessary. For Form procedures,
saves the current record before scrolling.
Scrolls down one page in the BrowseBox or to the next record on the same
level in a RelationTree. For Form procedures, saves the current record before
scrolling.
Scrolls to the last row in the BrowseBox or to the next parent record in a
RelationTree. For Form procedures, saves the current record before scrolling.
137
Template Guide
On a Form procedure only, pastes into the field with focus, the corresponding
value from the previously processed record (the value in the record buffer). In
other words, repeat the value from the previous saved record. Also known as
the "ditto" button.
Invokes Windows standard help behavior: calls WINHELP.EXE with the help
topic or keyword specified by the WINDOW's HLP attribute.
The Properties dialogs for the FrameBrowseControl buttons is the normal Button Properties dialog.
138
Template Guide
The Help Button control template populates a help button on a window that calls the program’s help file when pressed.
The help topic default is the Help ID that you have defined for the window.
There are no special prompts or actions for this control template.
IPDRV Options
This dialog is useful if you are using the IP Driver addon product, and accessible through the Browse Box Procedure
Properties > Browse Box Behavior > Extended Options.
The IP Driver is used for data access and transfer over an IP protocol. More information regarding this powerful addon
can be found at the SoftVelocity web site.
If MRP use is set to ON in a BROWSE procedure, the IP Driver returns a full page of records from the server, instead of
one record at a time. In a Report or Process, the MRP is set to the value of RecordsPerCycle. The MRP reduces the
roundtrips to the server dramatically. However, if you are doing hand-coded file access for each record read (i.e., NEXT,
GET, ADD, PUT, etc.) inside the LOOP structure used to fill the List control, or during a Report or Process Procedure, set
this checkbox to FALSE (unchecked).
For more information, see the following related properties and methods:
UseMRPUseMRP_IPD_Multiple_Request_Packet_Support_, SetUseMRPSetUseMRP_set_UseMRP_value_BC,
GetUseMRPGetUseMRP_get_UseMRP_value_BC
139
Template Guide
This template is not appropriate for databases with a very large primary file. For large files you should use the BrowseBox
Control template.
The plus (+) sign indicates a collapsed level that expands when the user CLICKS on the plus (+) sign. Conversely, the
minus (-) sign indicates an expanded level that collapses when the user CLICKS on the minus (-) sign.
The tree control is a single column list, therefore you must specify a column scroll bar rather than a list scroll bar to
accomplish horizontal scrolling.
140
Template Guide
141
Template Guide
To specify the default styles and any conditional styles, highlight the column's field name, then press the Properties
button. This opens the Customize BrowseBox Styles dialog. A default style may also be defined on the List Box Formatter
Appearance tab.
Default Style
This entry lets you specify the default style to be used for the column.
Style Type
Use the drop list to select Local List or Style Number. The Local List displays the descriptions of the styles that you
created in the Listbox Styles dialog. You can also reference the styles by Style Number only.
Style or Style Number
Based on the Style Type selected, select a style’s description or number from the drop list control.
Conditional Styles
This list lets you define the styles to apply when an expression evaluates to true (nonzero or non-blank). To add an
expression and its associated colors, press the Insert button.
Condition
Provide a valid Clarion expression that when evaluates to true (nonzero or non-blank) will cause the Style to be applied.
Style Type
Use the drop list to select Local List or Style Number. The Local List displays the descriptions of the styles that you
created in the Listbox Styles dialog. You can also reference the styles by Style Number only.
142
Template Guide
Press the ellipsis button to call the Select Column dialog. This dialog is used to help you construct syntactically correct
expressions to use in the appropriate prompt. All expressions must be prepended with an exclamation point as shown
above.
Field to Display
The field name to display for the primary file level. This may also be any valid Clarion expression. Press the ellipsis button
to call the Select Column dialog. This dialog is used to help you construct syntactically correct expressions to use in the
appropriate prompt.
Advanced Display
If the text to display is part of a more complex expression, or even perhaps the result of a procedure call, this button
opens an appropriate embed point to use to construct the value to return.
Record Filter
Type a valid Clarion expression to limit the contents of the list to only those records causing the expression to evaluate to
true (nonzero or non-blank). The procedure loops through all displayable records to select only those that meet the filter.
You must BIND any file field, variable, or EQUATE that is used in a filter expression. The Hot Fields tab lets you BIND
fields.
There is also Range Limit support in the MultiChild Relation Tree. Set the Range Limit options as you would in a
standard Browse Box. Click here for more information.
Icons
This tab is only available if you select an Icon in the Appearance tab in the List Box Formatter.
Use different icons for Expand and Contract
Check this box to enable you to select different icons to display when the relation tree is in an expanded or contracted
state. This option also cascades to the Conditional Icons option.
Default Icon
To specify the default icon for the primary file display string, first select the type of icon to use.
Icon Type
In the drop list provided, select from Built-in (pick from a built-in IDE list), File (a standard .ICO file), Variable (using the
!variable format), or External (to reference icons in a composite *ICO file, using the filename.ico[x] format).
Conditional Icons
This dialog lets you specify conditional icons for the primary file display string.
143
Template Guide
To specify conditional icons for the primary file display string, press the Insert button. This opens the Conditional Icon
Usage dialog.
Press the ellipsis button to call the Select Column dialog. This dialog is used to help you construct syntactically correct
expressions to use in the appropriate prompt.
Condition
Type a valid Clarion expression to evaluate at runtime.
Icon Type and Icon
In the drop list provided, select from Built-in (pick from a built-in IDE list), File (a standard .ICO file), Variable (using the
!variable format), or External (to reference icons in a composite *ICO file, using the filename.ico[x] format).
At run-time these conditions are evaluated, and the icon for the first true condition in the list is used.
Colors Tab
This tab is only available if you check the Colors box in the Flags area located in the List Box Formatter.
Default Colors
To specify the default colors for the primary file display string, type color EQUATEs (from \LIBSRC\EQUATES.CLW) in
the entry fields or press the ellipsis (...) buttons to select colors from the Select Color dialog.
Conditional Colors
To specify conditional colors for the primary file display string, press the Insert button. This opens the Conditional Color
Assignments dialog.
Condition
Type a valid Clarion expression to evaluate at runtime, then type color EQUATEs (from \LIBSRC\EQUATES.CLW) in the
entry fields or press the ellipsis (...) buttons to select colors from the Select Color dialog.
Press the ellipsis button to call the Select Column dialog. This dialog is used to help you construct syntactically correct
expressions to use in the appropriate prompt.
At run-time these conditions are evaluated, and the colors for the first true condition in the list are used.
Styles Tab
This tab is only available if you check the Style box in the List Box Formatter. It displays a list of the BrowseBox columns
that may have applied styles.
To specify the default styles and any conditional styles, highlight the column's field name, then press the Properties
button. This opens the Customize BrowseBox Styles dialog. A default style may also be defined on the List Box Formatter
Appearance tab.
Default Style
This entry lets you specify the default style to be used for the column.
Style Type
Use the drop list to select Local List or Style Number. The Local List displays the descriptions of the styles that you
created in the Listbox Styles dialog. You can also reference the styles by Style Number only.
Style or Style Number
Based on the Style Type selected, select a style’s description or number from the drop list control.
Conditional Styles
This list lets you define the styles to apply when an expression evaluates to true (nonzero or non-blank). To add an
expression and its associated colors, press the Insert button.
144
Template Guide
Condition
Provide a valid Clarion expression that when evaluates to true (nonzero or non-blank) will cause the Style to be applied.
Style Type
Use the drop list to select Local List or Style Number. The Local List displays the descriptions of the styles that you
created in the Listbox Styles dialog. You can also reference the styles by Style Number only.
Style or Style Number
Based on the Style Type selected, select a style’s description or number from the drop list control.
At run-time the expressions are evaluated, and the styles for the first true expression are used.
All Styles must be defined. For more information on defining styles see Listbox Styles.
Custom Join
A powerful feature of this template is that you can use tables that are not necessarily related in the dictionary to build your
relation tree. If you have specified a Custom Join in the table schematic for this table, you can specify the type of join used
here by pressing this button. In the Custom Join dialog you select the Key and Key Field used, and then specify the join
criteria. The Join of this table to the primary table can be based on a Clear Value, a Fixed Value, or a Variable Value.
145
Template Guide
For example:
Assume that a User and Computers table are not related to any table in the dictionary.
You can show them at the same tree level by creating a "Dummy" root:
DummyRoot
|
Users
| \---ComputersAssigned
| \---ComputersAlias
|
Computers
Users and Computer are not be related to DummyRoot. The custom join will use the "Clear Value" option to show all
Users and all Computers.
In the case of ComputersAssigned and ComputersAlias, the template uses smart logic to show them all like one entry
because the relation between ComputersAssigned and ComputersAlias is a Many to One.
Record Filter
Type a valid Clarion expression to limit the contents of the list to only those records causing the expression to evaluate to
true (nonzero or non-blank). The procedure loops through all displayable records to select only those that meet the filter.
You must BIND any file field, variable, or EQUATE that is used in a filter expression. The Hot Fields tab lets you BIND
fields.
Level Root
An optional text heading can be added to each child table to display at the top of the child node. For example:
146
Template Guide
Press the ellipsis button to call the Select Column dialog. This dialog is used to help you construct syntactically correct
expressions to use in the appropriate prompt.
The Level Root Format button opens an additional dialog to control the Colors, Icons and Styles used in the Child Root.
The options are identical to the Primary Root dialog.
147
Template Guide
General Tab
Disable Condition
Specify a condition that will disable the button for all tree elements when evaluated to TRUE. An example of this is an
"access level" that grant rights for special modifications specified by this button.
Use Button via Popup
Check this box to allow this button (when enabled) to appear on the relation tree popup menu.
Add Separation
Check this box to add a popup menu separator after the button item.
Popup Text
You can use the default button text in the popup menu, or specify via the Use Alternative Text check box different popup
menu text here.
Popup Priority
The order of the popup menu item is specified by a priority number here. It is recommended to develop standards of
priorities to prevent clashes or duplicates with other Relation Tree templates.
Refresh Tree After Action
After the button action is performed, check this box to force a refresh of the relation tree’s contents.
Disable Condition
Specify an optional condition that will disable the button for the selected primary record when evaluated to
TRUE.
Allow Popup
Check this box to allow this button (when enabled) to also appear on the relation tree popup menu when a primary record
is selected.
148
Template Guide
Root Options:
Enable Button on Root
Check this box to enable this button when the primary root element is active (selected).
Disable Condition
Specify an optional condition that will disable the button for the selected primary root when evaluated to TRUE.
Allow Popup on Root
Check this box to allow this button (when enabled) to also appear on the relation tree popup menu when the primary root
is selected.
Item Options:
Enable Button
Check this box to enable this button when the child element is active (selected).
Disable Condition
Specify a condition that will disable the button for the selected child element when evaluated to TRUE.
Allow Popup
Check this box to allow this button (when enabled) to appear on the relation tree popup menu.
Root Options:
Enable Button on Root
Check this box to enable this button when the secondary (child) root element is active (selected).
Disable Condition
Specify an optional condition that will disable the button for the selected secondary (child) root when evaluated to TRUE.
Allow Popup on Root
Check this box to allow this button (when enabled) to also appear on the relation tree popup menu when the secondary
(child) root is selected.
149
Template Guide
This Control template is dependent upon the existence of the MultiChildRelationTree control template, and adds three
buttons (Insert, Change, and Delete) which allow the user to call the associated update procedure for the selected level
of the relation tree (if an update procedure has been specified) . The Change and Delete buttons correspond to the
currently highlighted record. The Insert button adds the target child record (the next level down the tree structure).
The following template prompts are available:
General Tab
The options in the General tab target the relation tree’s popup options.
Use Update via Popup
Check this box to allow update actions (Insert, Change, Delete) to be called from a popup menu
Add Separation
Check this box to also include a separator in the popup menu after these update items
Use Button Text for Popup (Text)
Check this box to automatically assign the update button text to the popup menu item. If you turn this option off, the
default text of the popup menu (Insert…, Change…, Delete) will be used.
Use Alternative Update (Key)
If you would like to assign an alternate key to call the popup menu, check this box, and designate an Activation Key. You
can use the ellipsis button to access the Select Key dialog to assist you.
Use Help Tool tip
Check this box if you would like to use the help tool tip of each update button as a tool tip for the popup menu.
Popup Priority
Enter a number here that will set the order that the update items will appear on the popup menu. A smaller number will
bring the items to the top of the popup menu.
Primary Level
The options in the Primary Level tab target the optional Update Procedure used for the relation tree’s primary table.
Update Procedure
Select the update procedure to call for the primary file. You can enter a new one, or select from the drop list. The
procedure selected may be accessed with the RIGHT-CLICK popup menu when enabled automatically provided when
you specify an update procedure. The default popup menu text is "Insert…," "Change…," and "Delete." If your update
procedure has parameters, you can specify them in the Call with parameters option.
Finally, optionally check the Allow Insert, Allow Change, Allow Delete, or Allow View check boxes to enable the
appropriate action.
Child Levels
The list box in the Child Levels tab displays all child tables used in the relation tree. If an update procedure is designated
for a child table, the list box item will show "Edit <Child Table> with <update procedure>". If am update procedure is not
designated, the list box item will show "<child table> not edited" instead. Press the Properties button to access the
Secondary Level dialog and the following options:
150
Template Guide
Update Procedure
Select the update procedure to call for the selected child table. You can enter a new one, or select from the drop list. The
procedure selected may be accessed with the RIGHT-CLICK popup menu when enabled automatically provided when
you specify an update procedure. The default popup menu text is "Insert…," "Change…," and "Delete." If your update
procedure has parameters, you can specify them in the Call with parameters option. An optional description can be
added here, which is only used for developer documentation (it is not generated in source).
Finally, optionally check the Allow Insert, Allow Change, Allow Delete, or Allow View check boxes to enable the
appropriate action.
Allow MANY:1 Child Autoinc
Whenever you insert a child record check this box to enable the MultiChildRelationTree to prime the lookup file before
calling the child update form. The default is OFF.
151
Template Guide
Event Handler Check this box to generate an event handling callback function. Clarion's
runtime library calls this function when an OCX event needs to be
passed to your program.
Property Change Check this box to generate a property change callback function. Clarion's
runtime library calls this function when an OCX property is changed.
Property Edit Check this box to generate a property edit callback function. Clarion's
runtime library calls this function when an OCX property change is
requested, but permission to make the change is required from your
program before making the change.
Include OCX.CLW Check this box to include prototypes for OCX related functions
in global MAP (callbacks, register callbacks, unregister callbacks, etc.) in your
program's global MAP.
Include Check this box to include common OCX event equates in your program's
OCXEVENT.CLW in global data section.
global data section
OLE BLOB field Specify a BLOB to contain the OLE object, or press the ellipsis (...)
button to select the BLOB from the Select Field dialog.
152
Template Guide
Pause Text The text to display on the button when the process is running. This text
alerts the user that the process can be paused by pressing the button.
The default is Pause.
Restart Text The text to display on the button when the process is paused and
multiple starts are allowed. This text alerts the user that the process can
be restarted by pressing the button. The default is Restart.
Start Paused The state of the control when the procedure starts. If check, the process
is paused until the user presses the button.
Start Text The text to display on the button when the procedure opens. This text
alerts the user that the process can be strated by pressing the button.
The default is Go.
Allow Multiple Check this button to allow the process to start more than once.
Starts
When Pressed The standard set of prompts for buttons.Normally, when using a Control
template, these prompts are not used.
153
Template Guide
ProcessReportQBEButton
The ProcessReportQBEButton template places a Query button on the progress window for a Process or Report
procedure. This button allows the end user to apply a dynamic (run-time) filter to a report. The end user can query the
underlying data and print the results of the query in a report. This control template requires a PauseButton control
template on the Progress Window to allow the end user the opportunity to press the Query button.
The prompts for this control template mirror the template prompts for the BrowseQueryButton control template. See Read-
Write Browse Templates—BrowseQueryButton for the deatiled information on these prompts.
The end user may provide filter criteria for zero or more columns. Additional filter criteria result in a more refined search
and a smaller result set (the filter conditions are conjunctive—ANDed together).
Runtime Options
The default comparison operator is ( = ), which searches for an exact match between the Report field and the
corresponding Query input field. By default all matches are case sensitive. Pressing the comparison operator button
cycles through all the available operators:
no filter
For string fields, you may use the following special characters in the Query input field to refine your search:
For example:
Upon completion of the Query dialog, the current sort order of the Report is filtered to match the query. If Query is
selected again, the previous query is available by default. This allows sharing of filters between sort orders, as well as
successive filter refinements.
The standard Query behavior is defined by the ABC Library's QueryClass. See QueryClass, QueryFormClass, and
QueryFormVisual for more information.
154
Template Guide
QBE Family Specify the query family for the QBE interface.
Normally this is the name of the procedure.
QBE Interface Select the query interface from the drop-down list.
Choose from:
Form
One input field and button per Query field
List
One listbox row per Query field
Auto Populate Check this box to provide a query dialog with filter
criteria for each field in the Report. The input fields
have the same picture token and prompt as the
corresponding Report field.
Caseless Auto Populate Check this box to do case insensitive searches for
each field in the Report. Clear the box to do case
sensitive searches.
Picture Type a picture token for the Query field, or press the
ellipsis button to select a token with the Edit Picture
dialog.
155
Template Guide
Use on startup Check this box to open the Query dialog before the
Browse procedure opens.
QBE Class
Select this tab to override the global Query Manager setting. See Template Overview—Classes Tab Options—Global and
Local.
QBE Visual Class
Select this tab to override the global Query Manager setting. See Template Overview—Classes Tab Options—Global and
Local.
156
Template Guide
BrowseQueryButton
The BrowseQueryButton template provides a Query button to let the end user apply a dynamic (run-time) filter to the
BrowseBox result set. In other words, the end user can query the underlying dataset and display the results of the query
in the BrowseBox list.
The default query interface is a dialog with an input field and a comparison operator button for each list box column.
The end user may provide filter criteria for zero or more fields. Additional filter criteria result in a more refined search and
a smaller result set (the filter conditions are conjunctive--ANDed together).
Runtime Options
The default comparison operator is ( = ), which searches for an exact match between the BrowseBox field and the
corresponding Query input field. By default all matches are case sensitive. Pressing the comparison operator button
cycles through all the available operators:
no filter
For string fields, you may use the following special characters in the Query input field to refine your search:
For example:
Upon completion of the Query dialog, the current sort order of the BrowseBox is filtered to match the query. If Query is
selected again, the previous query is available by default. This allows sharing of filters between sort orders, as well as
successive filter refinements.
The standard Query behavior is defined by the ABC Library's QueryClass. See QueryClass, QueryFormClass,
QueryFormVisual, QueryListClass, and QueryListVisual for more information.
157
Template Guide
158
Template Guide
QBE Class
Select this tab to override the global Query Manager setting. See Template Overview--Classes Tab Options--Global and
Local.
QBE Visual Class
Select this tab to override the global Query Manager setting. See Template Overview--Classes Tab Options--Global and
Local.
159
Template Guide
The tree control is a list box formatted to display as a collapsible hierarchical list. This Control template provides an
alternative for the Browse-Form paradigm. A single RelationTree control can replace several Browse-Form pairs.
Using the RelationTree Control template, you can specify multiple related files to display on multiple levels (up to 29) of a
hierarchical list--with an associated update procedure for each level. The related files are declared in the Data / Tables
Pad--the Primary (Parent) file and a single chain of related secondary Child files (Parent-Child-GrandChild).
The RelationTree template employs a fully-loaded QUEUE for the root level. The child levels are demand-loaded when a
branch is expanded.
This template is not appropriate for databases with a very large primary file. For large files you should use the BrowseBox
Control template.
The plus (+) sign indicates a collapsed level that expands when the user CLICKS on the plus (+) sign. Conversely, the
minus (-) sign indicates an expanded level that collapses when the user CLICKS on the minus (-) sign.
To create a tree using the RelationTree Control template:
Place a RelationTree Control template on a window.
This opens the List Box Formatter. Use the List Box Formatter to enable colorization, icon display, or horizontal
scrolling in your tree control (see The List Box Formatter). Do not use the List Box Formatter to populate fields in the
tree control.
The tree control is a single column list, therefore you must specify a column scroll bar rather than a list scroll bar to
accomplish horizontal scrolling.
Press the OK button on the List Box Formatter.
RIGHT-CLICK on the RelationTree Control template and choose Actions from the popup menu.
Access the Data / Tables Pad to specify the file schematic for the control.
Specify the Primary (Parent) file and a single chain of related Secondary Child files (Parent-Child-GrandChild).
Complete the RelationTree template prompts.
160
Template Guide
Press the E button to call the Expression Editor. This dialog is used to help you construct syntactically correct expressions
to use in the appropriate prompt.
Tree Heading Icon
An optional icon at the top of the tree. Icons must be enabled in the List Box Formatter for this prompt to be enabled.
Expand Branch
Specify a keystroke to expand the selected list item--display its children. Press the ellipsis button (...) to select special
keys such as ESC, TAB or ENTER. See Controls and Their Properties--Common Control Attributes--Setting the KEY
Attribute for more information on this dialog.
Contract Branch
Specify a keystroke to contract the selected list item--hide its children. Press the ellipsis button (...) to select special keys
such as ESC, TAB or ENTER. See Controls and Their Properties--Common Control Attributes--Setting the KEY Attribute
for more information on this dialog.
Accept control from Toolbar
Check this box to accept navigation events and other relation tree control events generated by the FrameBrowseControl
control template on the APPLICATION's toolbar. See FrameBrowseControl for more information on these toolbar buttons
and their operation. Clear this box to disable the FrameBrowseControl toolbar buttons for this procedure.
Give option to expand and contract all levels
Specify the RIGHT-CLICK popup menu for the RelationTree includes "Expand All" and "Contract All" commands.
Primary Files – Primary File Details
Display String
The field name or text to display for the primary file level. This may be any valid Clarion expression, for example:
CLIP(CUST:LastName)&' '&CUST:FirstName
Press the E button to call the Expression Editor. This dialog is used to help you construct syntactically correct expressions
to use in the appropriate prompt.
Update Procedure
The update procedure to call for the primary file. The procedure may be accessed with the RIGHT-CLICK popup menu
automatically provided when you specify an update procedure. The default popup menu text is "Insert," "Change," and
"Delete."
The procedure may also be accessed with the RelationTreeUpdateButtons--see below. If you use the
RelationTreeUpdateButtons control template, the popup menu inherits the text from the buttons.
Record Filter
Type a valid Clarion expression to limit the contents of the list to only those records causing the expression to evaluate to
true (nonzero or non-blank). The procedure loops through all displayable records to select only those that meet the filter.
You must BIND any file field, variable, or EQUATE that is used in a filter expression. The Hot Fields tab lets you BIND
fields.
Colors
This tab is only available if you check the Color Cells box in the List Field Properties in the List Box Formatter.
Default Colors
To specify the default colors for the primary file display string, type color EQUATEs (from \LIBSRC\EQUATES.CLW) in
the entry fields or press the ellipsis (...) buttons to select colors from the Select Color dialog.
Conditional Color Assignments
To specify conditional colors for the primary file display string, press the Insert button. This opens the Conditional Color
Assignments dialog.
161
Template Guide
This dialog lets you specify the conditional colors for the primary file display string.
Condition
Type a valid Clarion expression to evaluate at runtime, then type color EQUATEs (from \LIBSRC\EQUATES.CLW) in the
entry fields or press the ellipsis (...) buttons to select colors from the Select Color dialog.
Press the E button to call the Expression Editor. This dialog is used to help you construct syntactically correct expressions
to use in the appropriate prompt.
At run-time these conditions are evaluated, and the colors for the first true condition in the list are used.
Icons
This tab is only available if you check the Icons box in the List Field Properties in the List Box Formatter.
Default Icon
To specify the default icon for the primary file display string, type the icon filename in the entry field.
Conditional Icon Usage
This dialog lets you specify conditional icons for the primary file display string.
To specify conditional icons for the primary file display string, press the Insert button. This opens the Conditional Icon
Usage dialog.
Press the E button to call the Expression Editor. This dialog is used to help you construct syntactically correct expressions
to use in the appropriate prompt.
Condition
Type a valid Clarion expression to evaluate at runtime.
Icon
Type the icon filename in the entry field.
At run-time these conditions are evaluated, and the icon for the first true condition in the list is used.
Secondary File Settings
The secondary file settings are identical to the primary file settings. Highlight the secondary file, then press the Properties
button below the Secondary Files list box. See RelationTree Overview for information on how to specify the secondary
files with the Select File dialog.
162
Template Guide
Format Picture Press the ellipsis button to select a date format. See Picture Tokens in
the Language Reference.
Use System Check this box to display the system date (see TODAY in the Language
Clock? Reference). Clear the box to display a variable containing the date value
to display.
Date Variable Type the variable name or press the ellipsis button to select the variable
from the Select Fields dialog.
163
Template Guide
Format Picture Press the ellipsis button to select a time format. See Picture Tokens in
the Language Reference.
Use System Check this box to display the system date (see CLOCK in the Language
Clock? Reference). Clear the box to display a variable containing the time value
to display.
Time Variable Type the variable name or press the ellipsis button to select the variable
from the Select Fields dialog.
164
Template Guide
This template (and its associated support templates) replaces the RTF Control template, and its associated extension and
code template support.
In essence, this template simply adds a TEXT control to your window, with the RTF attribute applied. It also uses a Field
as the RTF Value Mode parameter.
The normal design flow of the new RTF text control support is as follows:
1. Populate the RTFTextControl
2. Populate the RTFToolbar
3. Populate the StatusBar
4. Add the RTFAction Code template to additional control and event embed points if needed.
Context Menu
The Context Menu interface allows you to construct custom menu items to add to the existing popup menu used with the
RTF control. You can select from a list of actions to attach to each menu item that you create.
Press the appropriate button to add (Insert), modify (Properties), or remove (Delete) a context menu item. The following
options are available or the subsequent dialog.
Is a separator?
Check this box if you would like to add a separator line to your context menu. There are no other prompts associated with
this action.
Menu Text
Enter the name of the context menu item to display.
When Pressed
No Special Action
The menu item will have no template-generated action associated with it. This option normally is used when you
are using an embed point to control this menu’s action.
Execute Routine
Enter a valid Routine Name here. Of course, you must have the ROUTINE defined within the scope of this
procedure.
Post Event to Control
Select a valid Field Equate from the drop list to post an event to the Control. Select an Accepted or Selected
Event to post to the control from the drop list provided.
Call a Procedure
The RTF Context Menu interface uses the standard interface for calling a procedure. If you need more detailed
help here, see the following topic.
165
Template Guide
Run a Program
The RTF Context Menu interface uses the standard interface for running a program. If you need more detailed
help here, see the following topic.
You can translate the contents of the default popup menu items by using the ContextMenuTranslate method Parent Call
embed point as shown below:
The exact texts of standard (default) items of the standard RTF control context menu are as follows:
&Undo
Copy
Cut
&Paste
Delete
Select &all
Insert object...
Paste special...
166
Template Guide
Classes
The Classes tab lets you control the classes (and objects) your procedure uses to accomplish the template's task—that is,
they override the global class settings specified in the Global Properties dialog. You may accept the default Application
Builder Class specified in the Global Properties dialog (recommended), or you may specify your own or a third party
class to override the default setting. Deriving your own class can give you very fine control over the procedure when the
standard Application Builder Class is not precisely what you need.
Object Name
Set the object's label for the template-generated code.
Use Default Application Builder Class?
Check this box to use the default Application Builder Class specified in the Global Properties dialog. Clear this box to
use a class other than the default, and to enable the following prompts.
Use Application Builder Class?
Check this box to select a class from the Base Class drop-down list. The list includes all classes with the LINK attribute in
\LIBSRC\*.INC files. Clear this box to specify a class declared elsewhere.
Base Class
If you checked the Use Application Builder Class? box, select a class from the drop-down list. If you cleared the Use
Application Builder Class? box, type the class label here, and type the name of the source file that contains the class
declaration in the Include File entry box.
Include File
If you cleared the Use Application Builder Class? box, type the class label in the Base Class entry box, and type the
name of the source file that contains the class declaration here.
Derive?
Check this box to derive a class based on the parent class specified above and to enable the New Class Methods and
New Class Properties buttons to define any new properties and methods for the derived class.
This prompt is primarily to allow you to define new properties and methods in a derived class. To override existing
methods, simply embed code in the corresponding method embed points.
Using Derive?, New Class Methods and New Class Properties makes the template generate code similar to the
following:
MyProcess CLASS(Process) !derive a class from the parent class
NewMethod PROCEDURE !prototype new class method
NewProperty BYTE !declare new class property
END
The template automatically derives from the parent class if you embed code into any of the derived method
embed points, regardless of the status of this check box.
New Class Methods
Press this button to specify the new method prototypes to generate into the derived CLASS structure. This opens the New
Class Methods dialog (see New Class Methods).
New Class Properties
Press this button to specify the new property declarations to generate into the derived CLASS structure. This opens the
New Class Properties dialog (see New Class Properties).
Application Builder Class Viewer
Press this button to display classes, properties, and methods used by the ABC Templates, and the relationships between
parent and derived (child) classes. This utility can help you analyze and understand the classes that the ABC Templates
use.
167
Template Guide
168
Template Guide
Prompts you to load an external RTF file’s contents into the RTF
control
Open
Opens the Find dialog window, allowing you to search for text in the
RTF control.
Find
Opens the Find and Replace dialog window, allowing you to search
and replace target text in the RTF control.
Find and Replace
Performs the standard Windows cut, copy and paste actions for
selected text in the RTF control.
Cut, Copy and
Paste
Press this button to access the Tabs dialog. Set your tab stops in
millimeters, inches, or twips. The hotkey to move to the next tab stop
Tab Stops
is CTRL+TAB
Press this button to access the Paragraph Indents dialog. Set the
First line, Left side and Right side of the paragraph in millimeters,
Paragraph Indents
inches, or twips.
169
Template Guide
Full justification is currently only supported in Rich Edit versions greater than 3.0. The presence of RichEdxx.DLL is
required in the Windows System directory.
These
controls
Font and Colors set all
aspects of
the active
font and
color to
use in the
RTF
control.
To conditionally hide controls at runtime, you can use the following embedded source in the Window Manager’s Init
Method (just after the first RTFControl Initialization embed point):
IF NeedToHideSave !locally defined flag
HIDE(?RTFToolSave) !hide Save button
RTFControl19.AddItem(RTFToolbar:CtlButtonSave,0)
!the AddItem method disables Save button logic
END
Use this technique for any button that you need to conditionally display.
170
Template Guide
The SaveButton template does not detect changes to BLOBs; therefore, if only the BLOB changes, the SaveButton
template does not save it.
171
Template Guide
Specifying a key here also enables the FrameBrowseControl's "ditto" button . This button also restores the value from
the last saved record.
Location of Message
Specifies where the message displays.
Choose from:
None/Window Control
Embed your own code to display the message in a control.
Title Bar
Display the message in the window's title bar.
Status Bar
Display the message in the window's status bar. Optionally specify which section of the status bar in the Status Bar
Section box.
172
Template Guide
The SaveChangeButton template provides an icon "Save" button for your form window (or any window that has a
Save Button template populated). The purpose of this template is to allow a user to update a form as they navigate from
field to field. This can be particularly useful with very large form dialogs.
The SaveButton template provides the following prompt:
Sheet Control Select the Sheet control that contains the tab controls that control the
browse box sort orders. Each tab control represents a different browse
sorting sequence. The default sheet control Field Equate Label is
?CurrentTab, but you can select any valid sheet control in the drop list
provided.
Hide Sheet Check this box to hide the sheet (and associated tab controls) that you
selected from the Sheet Control prompt.
173
Template Guide
As you initially populate the Drop List control, press Cancel when the Field Selection Dialog is displayed. Press the No
Button when you are asked to Save Properties in the List Box Formatter. The template will automatically populate the
drop list box with sort order choices. The only required prompts are described below.
Another tip; when you populate the drop list, make sure that it is not placed on a tab control, but rather, on the window
itself. This will make it visible for all sort choices. You can verify this in the Window Designer’s Property Editor.
Sheet Control Select the Sheet control that contains the tab controls that control the
browse box sort orders. Each tab control represents a different browse
sorting sequence. The default sheet control Field Equate Label is
?CurrentTab, but you can select any valid sheet control in the drop list
provided.
Hide Sheet Check this box to hide the sheet (and associated tab controls) that you
selected from the Sheet Control prompt.
174
Template Guide
Procedure Templates
Select Procedure Template or Defaults
Wizards
Template Wizards are the most powerful design tool within the Application Generator. Here, you can select a base
procedure (Browse, Form, Report, etc.) or a whole application, and then fine tune the wizard prompts and options to
produce a near perfect application or procedure that fits your specifications.
See Template Wizards for more detailed information.
Defaults
The Defaults tab allows you to select from a wide variety of pre-defined structures and functionality. Based on the type of
default you select, the template procedure associated with it is automatically attached upon your selection.
Templates
This dialog lets you choose a procedure template, adding functionality to any new or "To Do" procedure in the Application
Tree .
CLICK on a procedure template from the list, then press the Select button. Once you select a procedure type, you can
customize it using its Procedure Properties dialog.
If you add third party, or your own customized templates to the Template Registry, they appear in the list. The following
lists the procedure templates which ship with Clarion:
175
Template Guide
See Also:
SoftVelocity ADO Browse Box
ADO Browse Update Buttons
ADO Form
The ADO Form procedure includes the template elements necessary to allow updates of an active ADO connection.
See Also:
ADO Save Button Control
The ADO Login Procedure Template provides a quick and easy way to allow ADO connections using a variety of different
techniques.
Two templates are associated with this procedure.
See Also:
ADO Process Control Extension
ADO Pause Process Button Control
176
Template Guide
Dictionary Print Wizard Prints information from your data dictionary, from full detail to
high level summary.
Quick Start Wizard Creates a Data Dictionary and an application based on the
dictionary.
Theme Maintenance Wizard Allows you to create and maintain wizard themes, which are
used as design criteria for the look and functions of the template
wizards.
177
Template Guide
If you are using the Quick Start Wizard, this is the only dialog that you will be presented with. Press the Finish button to
begin the creation of your application.
Button
The wizard builds the application with traditional Insert, Change, Delete, OK, and Cancel command buttons that appear
on each dialog.
178
Template Guide
Toolbar
The wizard builds the application with global toolbar command buttons that appear on the application frame. The toolbar
buttons control each dialog. See Control Templates-FrameBrowseControl for more information.
Both
The wizard builds the application with both the traditional dialog command buttons and the global toolbar command
buttons.
Customization
Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in
other applications. Themes are set and controlled by a variety of customization options.
Press the Next button to accept the selected theme’s settings, or press one of the customization buttons to modify them
at this time.
Frame CustomizationTPLWizardFrameCustomization
Browse CustomizationTPLWizardBrowseCustomization
Form CustomizationTPLWizardFormCustomization
Report CustomizationTPLWizardReportCustomization
You must have the appropriate template set registered in order to use this feature.
Single Key
Select this option to force the wizard to generate a separate report for each key defined in your file (or files).
179
Template Guide
Record Order
Select this option to force the wizard to generate a single report sorted by record order for your selected file (or files).
On the last dialog, the Finish button is enabled. If you are satisfied with your answers, press the Finish button. You also
have the option here to Save Changes, where any changes to customization options are saved to the theme that you
selected at the start of the wizard. If you wish, you can opt to Save on a new theme, and enter the new name of the
Theme and Theme file.
You can press the Back button to change a prior selection or press the Cancel button to abandon the application.
The Application Wizard creates the .APP file based on the dictionary and the answers you provided, and then displays the
Application Tree dialog for your new application.
180
Template Guide
Wizard--Control model
The Application Wizard creates one of three application types based on the model you specify.
Button The wizard builds the application with traditional Insert, Change, and Delete
command buttons that appear on each dialog.
Toolbar The wizard builds the application with global toolbar command buttons that
appear on the application frame.
Both The wizard builds the application with both global toolbar command buttons that
appear on the application frame and traditional Insert, Change, and Delete
command buttons that appear on each dialog.
181
Template Guide
After the introduction screen, you are presented with the following options:
Theme Selection
Theme Select from the drop list of themes. Themes are groups of settings that control
colors, fonts, icons, backgrounds, positions and much more - for Frame,
Browse, Form and Report procedures. You will have the opportunity to create
a new theme as you progress through the wizard. Select a starting or default
theme here.
Save Settings After you have selected a theme, you have the option to save these settings
for any future applications that you create.
182
Template Guide
Button The wizard builds the browse with traditional Insert, Change, and
Delete command buttons that appear on each dialog.
Toolbar The wizard builds the browse to use global toolbar command buttons
that appear on the application frame. See Control Templates -
FrameBrowseControl.
Both The wizard builds the browse to use both traditional dialog command
buttons and global toolbar command buttons.
Customization
Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in
other applications. Themes are set and controlled by a variety of customization options.
Press the Next button to accept the selected theme’s settings, or press one of the customization buttons to modify them
at this time.
Browse CustomizationTPLWizardBrowseCustomization
Form CustomizationTPLWizardFormCustomization
On the last dialog, the Finish button is enabled. If you are satisfied with your answers, press the Finish button. You also
have the option here to Save Changes, where any changes to customization options are saved to the theme that you
selected at the start of the wizard. If you wish, you can opt to Save to a new theme.
The Browse Procedure Wizard creates the procedure(s) based on the dictionary file and the answers you provided, and
then displays the Procedure Properties dialog for your new procedure.
183
Template Guide
After the introduction screen, you are presented with the following options:
Theme Selection:
Theme Select from the drop list of themes. Themes are groups of settings that control
colors, fonts, icons, backgrounds, positions and much more - for Frame,
Browse, Form and Report procedures. You will have the opportunity to create
a new theme as you progress through the wizard. Select a starting or default
theme here.
Save Settings After you have selected a theme, you have the option to save these settings
for any future applications that you create.
Insert Message
Type the title bar text to display when adding a record.
Change Message
Type the text to display when changing a record.
Delete Message
Type the text to display when deleting a record.
184
Template Guide
Button The wizard builds the dialogs with traditional Insert, Change, and
Delete command buttons.
Toolbar The wizard builds the form to use global toolbar command buttons
that appear on the application frame. See Control Templates -
FrameBrowseControl.
Both The wizard builds the form to use both traditional dialog command
buttons and global toolbar command buttons.
Customization
Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in
other applications. Themes are set and controlled by a variety of customization options.
Press the Next button to accept the selected theme’s settings, or press one of the customization buttons to modify them
at this time.
Form CustomizationTPLWizardFormCustomization
185
Template Guide
On the last dialog, the Finish button is enabled. If you are satisfied with your answers, press the Finish button. You also
have the option here to Save Changes, where any changes to customization options are saved to the theme that you
selected at the start of the wizard. If you wish, you can opt to Save to a new theme.
The Form Procedure Wizard creates the procedure(s) based on the dictionary table and the answers you provided, and
then displays the Procedure Properties dialog for your new procedure.
186
Template Guide
After the introduction screen, you are presented with the following options:
Theme Selection:
Theme Select from the drop list of themes. Themes are groups of settings that
control colors, fonts, icons, backgrounds, positions and much more - for
Frame, Browse, Form and Report procedures. You will have the opportunity
to create a new theme as you progress through the wizard. Select a starting
or default theme here.
Label Group Select a label group from the drop list. A label group contains the most
popular classes of labels (Avery, Card Products, InkJet, etc.). If your type of
label is not listed here, select Others.
Label Type Select a label type from the drop list. A label type normally corresponds to
its product code.
Save Settings After you have selected a theme, you have the option to save these settings
for any future applications that you create.
A report can use a single record key, or can run in record order. Enter a key below, or leave the field blank to run
in record order.
Press the ellipsis (...) button to select a sort key. Leave the field blank to specify no sort key.
Customization
Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in
other applications. Themes are set and controlled by a variety of customization options.
Press the Next button to accept the selected theme’s settings, or press the customization button to modify it at this time.
Check this box to overwrite existing procedures with the same names. Clear the box to preserve existing procedures.
On the last dialog, the Finish button is enabled. If you are satisfied with your answers, press the Finish button. You also
have the option here to Save Changes, where any changes to customization options are saved to the theme that you
selected at the start of the wizard. If you wish, you can opt to Save to a new theme.
188
Template Guide
189
Template Guide
Theme Select from the drop list of themes. Themes are groups of settings that control
colors, fonts, icons, backgrounds, positions and much more - for Frame,
Browse, Form and Report procedures. You will have the opportunity to create
a new theme as you progress through the wizard. Select a starting or default
theme here.
Save Settings After you have selected a theme, you have the option to save these settings
for any future applications that you create.
A process can use a single record key, or can run in record order. Enter a key below, or leave the field blank to
run in record order.
Press the ellipsis (...) button to select a sort key. Leave the field blank to specify no sort key.
Customization
Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in
other applications. Themes are set and controlled by a variety of customization options.
Press the Next button to accept the selected theme’s settings, or press one of the customization buttons to modify them at
this time.
Process CustomizationTPLWizardProcessCustomization
190
Template Guide
Theme Select from the drop list of themes. Themes are groups of settings that
control colors, fonts, icons, backgrounds, positions and much more - for
Frame, Browse, Form and Report procedures. You will have the opportunity
to create a new theme as you progress through the wizard. Select a starting
or default theme here.
Report Layout Select a default report layout from the drop list provided. This layout will be
the basis for all of the reports that will be generated by the wizard.
Save Changes? After you have selected a theme, you have the option to automatically save
changes to this theme for any future applications that you create.
Check this box to store changes when completing the wizard.
Single Key
Select this option to force the wizard to generate a seperate report for the key that you select in the Enter a key prompt
that follows.
Record Order
Select this option to force the wizard to generate a single report sorted by record order for your selected file (or files).
191
Template Guide
Build your report in this list box by adding and deleting fields from the selected file. You can also modify the properties of
the fields regarding column labels, picture tokens, and justification. Use the arrow buttons to specify the order that each
field will appear on the report.
Customization
Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in
other applications. Themes are set and controlled by a variety of customization options.
Press the Next button to accept the selected theme’s settings, or press the Report Customization button to modify it at
this time.
Report CustomizationTPLWizardReportCustomization
192
Template Guide
After the introduction screen, you are presented with the following options:
Theme Selection
Theme Select from the drop list of themes. Themes are groups of settings that
control colors, fonts, icons, backgrounds, positions and much more - for
Frame, Browse, Form and Report procedures. You will have the opportunity
to create a new theme as you progress through the wizard. Select a starting
or default theme here.
Save Settings After you have selected a theme, you have the option to save these settings
for any future applications that you create.
Customization
Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in
other applications. Themes are set and controlled by a variety of customization options.
Press the Next button to accept the selected theme’s settings, or press the Window Customization button to modify it at
this time.
193
Template Guide
If a WINDOW HLP ID is found, the procedure name is extracted and exported with the Help ID to a designated text file.
The Field Equate Label is also extracted for controls that have a Help ID assigned.
The leading tilde (~) is always stripped out of the generated output. The .HTM extension is visible when set by the
Global HTML Help Template.
194
Template Guide
2. Press the Template Utility button located in the Application toolbar menu. The Select Utility dialog appears.
3. Highlight DictionaryPrint and press the Select button.
The Dictionary Print Wizard dialogs appear.
4. Answer the question(s) in each dialog, then press the Next button. After the first dialog, the Finish button is
enabled.
5. Press the Finish button now to print all the information available for all the files, fields, keys, and relationships.Or,
step through the wizard's dialogs, to select specific files, plus the level of detail to print (All, Some, or None) for
the various dictionary components.
195
Template Guide
Wizard Themes
The Application Generator is packed with special template-based wizards, which are designed to help you generate rich,
full-featured applications or individual procedures, based on a series of simple information prompts and options.
These wizards also have different "look and feel" settings and actions called themes, which can be modified and saved for
use in other applications. Themes are set and controlled by a variety of customization options.
Browse Customization
The general appearance of the Browse Wizard is controlled by the settings on this window. These settings can be saved
in a "theme" for use in future applications.
Procedure Name
Enter a name that the Browse Wizard will use to generate procedure names in your application. The template macro
symbol, %FileName, is required, and extracts the Dictionary file name for each file selected by the wizard. You can modify
this line with other template macros and text if you wish. No spaces are allowed in procedure names.
Browse Message
Enter default text that the Browse Wizard will generate in the MSG attribute of each list box. The user will see this text in
the status bar of the runtime application when the list box is selected. The %FileName macro is not required here, but
recommended.
Window
Caption
Text that is entered on this line will be used as the description of the window used by the Browse Wizard.
Secondary Caption
Text that is entered on this line will be used as the message that appears in the status bar of a window only when the
browse box is populated as a secondary file on a Form.
Images:
Background
Enter a default image here to use as a graphic or watermark for your Browse window.
Mode
If you have designated a background image to use for your Browse window, this option becomes available to control if the
image is tiled, stretched, or centered.
Icon
Enter a default icon to use for your Browse procedure’s window. This will allow your Browse window to be minimized if
needed.
Font
Press the Font button to select a default font to use for the Browse procedure. Sample text shown below the button is
provided to allow you to review your selection.
Options
Select from the drop list to designate the initial position of your Browse window. You can center the window, or use the
default position that is set by the template wizard.
196
Template Guide
In addition, click on the System Menu check box to add the Windows System Menu to your Browse procedure. If you will
be using any entry fields on the Browse window, you can also click on the Entry Patterns check box to allow special
formatting picture information (Example: phone numbers or date pictures)
Tabs
Tab Text
Enter text that will be used for each tab control that is generated by the Browse wizard. The default setting is &%#) %Key.
The ampersand (&) identifies the next character as the hot key of the tab control. The %# macro identifies the instance or
order of the key
used in the tab control. The %Key is the description of the key name (or label of the key if the description in the Dictionary
Editor is blank).
Example: 2) By Account
Buttons
The Buttons tab is the central control for all buttons used on the window. There is a default Width and Height setting (in
dialog units) used for all buttons. However, each button can be overridden individually through the Button Customization
dialog.
The generation of each button is controlled by other settings within the template wizard. However, you can also override
the generation of the View and Help buttons by unchecking the appropriate boxes.
197
Template Guide
Button Customization
This window contains the generic settings used for selected buttons generated by the wizards. The title of the window
reflects which button’s properties is currently being modified (i.e., Insert Button, Close Button, etc.).
Common properties include:
Child Browse Proc Name (Only valid for the Child button)
Enter a procedure name that the button will call to browse a child file related to the active primary file. This button is
normally displayed in Form procedures to browse a Child file’s records to view or modify. The template macro symbol,
%FileName, is required, and extracts the Dictionary file name for the child file that is related to the Form’s parent. You can
modify this line with other template macros and text if you wish. No spaces are allowed in procedure names.
Window Name (Valid for the Parent Select and Child Buttons)
Text that is entered on this line will be used as the description of the window used by the procedure that is called by the
button.
Position
Choose from the drop list an approximate location to place this button, or select Other from the drop list to set custom
position parameters.
X
Enter an integer constant that specifies the horizontal position of the top left corner of the control.
Y
Enter an integer constant that specifies the vertical position of the top left corner of the control.
Width
Enter an integer constant that specifies the width of the specified control
Height
Enter an integer constant that specifies the height of the specified control.
Text
Enter the text to display on the button
Icon
Enter an icon file name, or use the ellipsis button to select an icon file that you wish to use for this button.
Cursor
Enter a cursor file name, or use the ellipsis button to select a cursor file that you wish to use for this button. The cursor will
be displayed when the mouse moves over the button area.
HotKey
Enter a Clarion keycode or equate, or press the ellipsis button to select a key to use as the hot key for this button.
Pressing the hot key at program runtime should activate the button.
Message
Enter a message to display in the status bar by default when the mouse moves over the button area.
Tip
Enter a tool tip message to display when the mouse moves over the button area.
198
Template Guide
Options
Activate the Flat check box to give the selected button a flat appearance.
Activate the Skip check box to disable tabbing to the selected button.
Select a Justification mode to designate where the icon (if any) will appear in relation to the button text.
Control Customization
Throughout parts of the Clarion template wizards, there are default window controls that are automatically populated as
part of a generated procedure. Each control has settings for the
X and Y, width and height parameters as follows:
X
Enter an integer constant that specifies the horizontal position of the top left corner of the control.
Y
Enter an integer constant that specifies the vertical position of the top left corner of the control.
Width
Enter an integer constant that specifies the width of the specified control
Height
Enter an integer constant that specifies the height of the specified control.
Justification
Select a Justification mode to designate how the text will appear in relation to the control’s position.
Options
For Progress controls, you also have the option to designate a vertical (bottom to top) orientation, and a smooth bar
display.
199
Template Guide
Form Customization
The settings on this window control the appearance of the Form procedure. These settings can be saved for use in other
future applications.
Procedure Name
Enter a name that the Form Wizard will use to generate procedure names in your application. The template macro
symbol, %FileName, is required, and extracts the Dictionary file name for each file selected by the wizard. You can modify
this line with other template macros and text if you wish. No spaces are allowed in procedure names.
Window
Caption
Text that is entered on this line will be used as the description of the window used by the Form Wizard.
Background
Enter a default image here to use as a graphic or watermark for your Form window.
Mode
If you have designated a background image to use for your Form window, this option becomes available to control if the
image is tiled, stretched, or centered.
Icon
Enter a default icon, or press the ellipsis button to select an icon file for use in your Form procedure’s window. This will
allow your Form window to be minimized if needed.
Font
Press the Font button to select a default font to use for the Form procedure. Sample text shown below the button is
provided to allow you to review your selection.
Options
Select from the drop list to designate the initial position of your Form window. You can center the window, or use the
default position that is set by the template wizard.
In addition, click on the System Menu check box to add the Windows System Menu to your Form procedure. If you will be
using any entry fields on the Form window, you can also click on the Entry Patterns check box to allow special formatting
picture information (Example: phone numbers or date pictures)
The Entry Mode drop list allows you to set the typing mode for the Form. Choose either Insert, Overwrite, or Default.
The Entry Mode applies only for windows with the MASK attribute set. Default accepts input according to the current
system settings.
200
Template Guide
Tabs
Form Tabs
Enter text that will be used for each tab control that will be generated by the Form wizard. The default setting is &%#)
%Text. The ampersand (&) identifies the next character as the hot key of the tab control. The %# macro identifies the
instance number of the tab generated, determined by the number of fields per tab control and the total number of fields
populated. The %Text is a declared template symbol that defaults to "General". You can remove this symbol and
substitute it with any text that you wish.
Example: 2) General
Buttons
The Buttons tab is the central control for all buttons used on the window. There is a default Width and Height setting (in
dialog units) used for all buttons. However, each button can be overridden individually through the Button Customization
dialog.
OK
Cancel
Child
Help
201
Template Guide
Frame Customization
The settings on this window control the appearance of the Frame procedure. These settings can be saved for use in other
future applications.
Window
Background
Enter a default image here to use as a graphic or watermark for your Frame procedure’s client area (the area below your
menu and toolbar by default).
Mode
If you have designated a background image to use for your Frame’s client area, this option becomes available to control if
the image is tiled, stretched, or centered.
Icon
Enter a default icon to use for your Frame procedure’s window. This will allow your default applications to be minimized if
needed.
Font
Press the Font button to select a default font to use for the Frame procedure. Sample text shown below the button is
provided to allow you to review your selection.
Position
Select from the drop list to designate the initial position of your Frame window. You can center the window, or use the
default position that is set by the template wizard.
In addition, click on the System Menu check box to add the Windows System Menu to your Frame procedure. If you will
be using any entry fields on the Frame window’s tool bar, you can also click on the Entry Patterns check box to allow
special formatting picture information (Example: phone numbers or date pictures)
FrameMenu
File
Enable File Menu
Check this box if you would like the wizard to create a File menu in your Frame procedure. In addition, you can customize
the following default menu items and their associated messages (which are displayed in the Frame’s status bar by
default):
File Menu Text
Print Item Text
Print Item Msg
Exit Item Text
Exit Item Msg
202
Template Guide
Edit
Enable Edit Menu
Check this box if you would like the wizard to create an Edit menu in your Frame procedure. In addition, you can
customize the following default menu items and their associated messages (which are displayed in the Frame’s status bar
by default):
Edit Menu Text
Cut Item Text
Cut Item Msg
Copy Item Text
Copy Item Msg
Paste Item Text
Paste Item Msg
Window
Enable Window Menu
Check this box if you would like the wizard to create a standard Window menu in your Frame procedure. In addition, you
can customize the following default menu items and their associated messages (which are displayed in the Frame’s status
bar by default):
Window Menu Text
Tile Item Text
Tile Item Msg
Cascade Item Text
Cascade Item Msg
Arrange Icons Item Text
Arrange Icons Item Msg
Help
Enable Help Menu
Check this box if you would like the wizard to create a standard Window menu in your Frame procedure. In addition, you
can customize the following default menu items and their associated messages (which are displayed in the Frame’s status
bar by default):
Help Menu Text
Contents Item Text
Contents Item Msg
Search Item Text
Search Item Msg
How Item Text
How Item Msg
Toolbar
General
Background
Enter a default image here to use as a graphic or watermark for your Frame’s toolbar.
Mode
If you have designated a background image to use for your Frame’s toolbar, this option becomes available to control if the
image is tiled, stretched, or centered.
Height
Enter the height in dialog units for the Frame procedure toolbar.
Tip
This tab identifies the toolbar buttons that are available from the wizard. You can modify the tool tip message for each
button here.
203
Template Guide
Icon Properties
Width
The Frame procedure wizard has the option to produce toolbar navigation buttons. Enter here the default width of each
button in dialog units.
Height
The Frame procedure wizard has the option to produce toolbar navigation buttons. Enter here the default height In dialog
units of each button. Care must be taken not to exceed the default height of the overall toolbar properties.
Flat
Activate this checkbox to produce a flat button appearance for all toolbar buttons.
Icon
This tab identifies the toolbar buttons’ default icon files used by the wizard. You can modify the icon files for each button
here.
204
Template Guide
Process Customization
The settings here control the appearance of the Process template procedure generated by the Process Wizard. These
settings can also be saved for use in other future applications.
Procedure Name
Enter a name that the Process Wizard will use to generate as a procedure name in your application. The template macro
symbol, %FileName, is required, and extracts the Dictionary file name for each file used by the wizard. You can modify
this line with other template macros and text if you wish. No spaces are allowed in procedure names. This name is used
for files that have no keys defined
Progress Window
Name
Text that is entered on this line will be used as the description of the window used by the Process Wizard.
Background
Enter a default image here to use as a graphic or watermark for your Process window.
Mode
If you have designated a background image to use for your Process window, this option becomes available to control if
the image is Tiled, Stretched, or Centered.
Icon
Enter a default icon, or press the ellipsis button to select an icon file for use in your Process procedure’s window. This will
allow your Form window to be minimized if needed.
Font
Press the Font button to select a default font to use for the Process window and controls. Sample text shown below the
button is provided to allow you to review your selection.
Options
Select from the drop list to designate the initial Width, Height , and Position of your Process window. You can optionally
center the window, or use the default position that is set by the template wizard.
Controls:
ProgressTPLWizardControlCustomization
Pct Text (Percentage control)TPLWizardControlCustomization
User String (user defined message)TPLWizardControlCustomization
Cancel ButtonButton_Customization
205
Template Guide
Justification
Select a Justification mode to designate how the text will appear in relation to the control’s position.
Cancel ButtonTPLWizardCustomizationButton
206
Template Guide
Report Customization
The settings here control the appearance of the Report procedure generated by the Report Wizard. These settings can be
saved for use in other future applications.
Procedure:
Procedure Name
Enter a name that the Report Wizard will use to generate procedure names in your application. The template macro
symbol, %FileName, is required, and extracts the Dictionary file name for each file selected by the wizard. You can modify
this line with other template macros and text if you wish. No spaces are allowed in procedure names. This name is used
for files that have no keys defined
Progress Window
Caption
Text that is entered on this line will be used as the description of the report’s progress window, and appear in the progress
window’s title bar.
Background
Enter a default image here to use as a graphic or watermark for your report’s progress window.
Mode
If you have designated a background image to use for your report’s progress window, this option becomes available to
control if the image is tiled, stretched, or centered.
Icon
Enter a default icon, or press the ellipsis button to select an icon file for use in your report’s progress window. This will
allow your window to be minimized if needed.
Font
Press the Font button to select a default font to use for the report’s progress window. Sample text shown below the button
is provided to allow you to review your selection.
Width
Enter the default width in dialog units for the report’s progress window.
Height
Enter the default height in dialog units for the report’s progress window.
Position
Select from the drop list to designate the initial position of your Progress window. You can center the window, or use the
default position that is set by the template wizard.
Controls
There are four default controls in the Progress Window that you can customize:
ProgressTPLWizardControlCustomization
Pct TextTPLWizardControlCustomization
207
Template Guide
User StringTPLWizardControlCustomization
Cancel ButtonButton_Customization
Report Layout
General
The settings in this tab control refer to the settings of the current active report layout, whose name is displayed at the top.
Job Name
Enter the print job name to use for the Windows Print Manager. If omitted, the REPORT's label is used. The default
setting is "Report %FileName".
Paper Type
Select the paper size for the report output from the drop list provided.
Paper Width
If you select "Other" as the Paper Type, you must enter a custom paper width.
Paper Height
If you select "Other" as the Paper Type, you must enter a custom paper height.
Margins
Margin setting control the printable area of your reports. Specify the Top, Bottom, Left and Right margin settings in
thousandths of an inch
Check the Automatic Adjust Top and Bottom box to allow auto resizing of the margins when the report header or footer
heights are resized.
Press the Adjust Using Header and Footer Size button to manually update the margin settings to conform to any changes
made to the header and footer height positions. This button is only enabled if the Automatic Adjust Top and Bottom box is
unchecked, to avoid sizing conflicts.
Orientation
Specify here what paper orientation the report layout will use (Portrait or Landscape).
Font
Press the Font Button to specify a default font to use for reports that the wizard will generate. There are several other
places where you can override this setting.
Show Preview
Check this box to designate that all reports generated by the wizard will have a Print Preview window associated with it.
Preview Maximized
If the Show Preview box is checked, you can designate here that the Print Preview window will open in maximized mode
(full screen).
208
Template Guide
Add Header
Check this box to allow your reports that are generated by the wizards to declare a HEADER section.
Background Color
If your user has support for color printing, you can designate a color to use as a background for the report’s header.
Report Title
Enter a string or expression that will be used as the report title for each report generated by the report wizard. Since you
can generate many report from different tables specified, it is a good idea to use a template macro here. The default is
"Report %FileName file"
Position Y
Specify the starting position of the report title, relative to the start of the printable header area. Value is expressed in
thousandths of an inch.
Justification
Specify how the contents of header text will be justified. The default is Center, but you can also specify Left or Right
justified.
Title Font
The report title’s font can be controlled with this setting. Press the Title Font button to designate the appearance of the title
text.
Position
Enter the starting X and Y coordinates for the upper left corner of the header area, which is measured in thousandths of
an inch, and relative to the upper left corner of the report’s printable area. Enter the header area’s width and height, also
measured in thousandths of an inch
Font
Press the Font button to select the font (typeface), size, style (such as bold or italic), color, and font effects (underline and
strikeout) for all controls in the header section. A sample of the selected font is displayed on the tab control.
Header Box
Check the Add Header box to add a box control to the report header. You will then be able to specify a color, Top (or
width), and Height settings.
Detail
The detail area is the "body" of the report. Usually, your most important and relevant data will be printed here.
Background Color
If your user has support for color printing, press the ellipsis button to designate a color here to use as a background for
the report’s detail area.
Position
Enter the starting X and Y coordinates for the upper left corner of the detail area, which is measured in thousandths of an
inch, and relative to the upper left corner of the report’s printable area, or to the last item printed in the detail print area.
Enter the detail area’s width and height, also measured in thousandths of an inch.
Font
Press the Font button to select the font (typeface), size, style (such as bold or italic), color, and font effects (underline and
strikeout) for all controls in the Detail section. A sample of the selected font is displayed on the tab control.
Add Detail Lines
Check this box to instruct the template to generate a horizontal line between each detail section printed.
209
Template Guide
Add Footer
Check this box to allow your reports that are generated by the wizards to declare a FOOTER section.
Background Color
If your user has support for color printing, press the ellipsis button to designate a color here to use as a background for
the report’s footer area.
Position
Enter the starting X and Y coordinates for the upper left corner of the footer area, which is measured in thousandths of an
inch, and relative to the lower left corner of the report’s detail area, or to the last item printed in the detail print area. Enter
the detail area’s width and height, also measured in thousandths of an inch.
Font
Press the Font button to select the font (typeface), size, style (such as bold or italic), color, and font effects (underline and
strikeout) for all controls in the report’s footer section. A sample of the selected font is displayed on the tab control.
Form
The Form Band is normally used to specify constant text or graphics which print on every page (for example, a watermark
or a tax form)
Add Form
Check this box to allow your reports generated by the wizards to specify a Form section.
Background Color
If your user has support for color printing, press the ellipsis button to designate a color here to use as a background for
the report’s form band area.
Margins
Margin settings control the printable area of your form band. Specify the Top, Bottom, Left and Right margin settings in
thousandths of an inch
Font
Press the Font button to select the font (typeface), size, style (such as bold or italic), color, and font effects (underline and
strikeout) for all controls in the report’s Form Band section. A sample of the selected font is displayed on the tab control.
Image
Add Image
Check this box to allow an image control to be populated on the Form band. This check box also enables the remaining
options.
Image File
Press the ellipsis button to select the name of the image file to be used in the populated image control. Any image format
supported by the Windows print engine may be selected.
Mode
Select from the drop list how the image file will be rendered on the report. Select from tiled, stretched, and centered.
210
Template Guide
Image Position
If width and height are zero(0), the image will use the settings specified by the form band. Set the X and Y position to
designate the anchor position of the top left corner.
Additions
211
Template Guide
The settings here control the appearance of the Report procedure with a Label layout generated by the Label Wizard.
These settings can be saved for use in other future applications.
Procedure
Procedure Name
Enter a name that the Label Wizard will use to generate procedure names in your application. The template macro
symbol, %FileName, is required, and extracts the Dictionary file name for each file selected by the wizard. You can modify
this line with other template macros and text if you wish. No spaces are allowed in procedure names. This name is used
for files that have no keys defined
Progress Window
Name
Text that is entered on this line will be used as the description of the report’s progress window, and appear in the progress
window’s title bar.
Background
Enter a default image here to use as a graphic or watermark for your report’s progress window.
Mode
If you have designated a background image to use for your report’s progress window, this option becomes available to
control if the image is tiled, stretched, or centered.
Icon
Enter a default icon, or press the ellipsis button to select an icon file for use in your report’s progress window. This will
allow your window to be minimized if needed.
Font
Press the Font button to select a default font to use for the report’s progress window. Sample text shown below the button
is provided to allow you to review your selection.
Width
Enter the default width in dialog units for the report’s progress window.
Height
Enter the default height in dialog units for the report’s progress window.
Position
Select from the drop list to designate the initial position of your Progress window. You can center the window, or use the
default position that is set by the template wizard.
212
Template Guide
Controls
There are four default controls in the Progress Window that you can customize:
Progress
Pct Text
User String
Cancel Button
Report Layout
General
The settings in this tab control refer to the settings of the current active report layout, whose name is displayed at the top.
Job Name
Enter the print job name to use for the Windows Print Manager. If omitted, the REPORT's label is used. The default
setting is "%FileName Report".
Orientation
Specify here what paper orientation the report layout will use (Portrait or Landscape).
Font
Press the Font Button to specify a default font to use for reports that the wizard will generate. There are several other
places where you can override this setting.
Show Preview
Check this box to designate that all reports generated by the wizard will have a Print Preview window associated with it.
Preview Maximized
If the Show Preview box is checked, you can designate here that the Print Preview window will open in maximized mode
(full screen).
213
Template Guide
Left margin
Enter the height of the label’s non-printable area, measured from the left edge of the page. For example, if you want the
first label to print one-half inch from the left edge, enter 500.
Number
Enter the number of labels to print across the page.
Number down
Enter the number of labels to print down the page.
Horizontal
Enter the horizontal distance between labels, measured from the left edge of one label to the left edge of the next label.
Vertical Pitch
Enter the vertical distance between labels, measured from the left edge of one label to the left edge of the next label.
Paper Type
Select a paper size from the drop list corresponding to the page size that you will print labels on. If you select Other, you
can customize the page size to any length and height, using the Paper Width and Paper Height settings.
214
Template Guide
Position
Specify which report band to populate the Date and Time controls. Select from Header, Footer, Detail, Form, and both
Header and Footer
Page Number
Add Page Number
Check this box to include an automatic Page Number template control on your report.
Position
Specify which report band to populate the Page Number control. Select from Header, Footer, Detail, Form, and both
Header and Footer
Page Picture
Press the ellipsis button to call up the Edit Picture dialog window, and build a picture token to use for the page number.
The default picture is @pPage <<#p
215
Template Guide
Save As Theme
Create a new theme?
Check this box to write your current changes to a new theme name and associated external file.
Save the choices that you made?
Check this box to preserve your settings on this window. For example, if you always want to save the report layout with
the theme, check this box.
Theme Name
Enter a name that will be used in the Theme Selection Drop List for all future wizard use.
File Name
Enter the physical file name that will be used to write your current changes to. Although it is not required, it is probably a
good idea to keep the file name consistent with the Theme name entered above.
Change Layout Name?
Check this box to write the current report layout changes to a new layout name.
New Layout Name
Enter the new layout name here.
Save It
Press this button to write the current changes to the theme file name entered above.
Press the OK button to maintain your current checkbox settings on this window, or press the Cancel button to reset them
to their original values when you entered this window.
Save Theme
Save the choices that you made?
Check this box to preserve your settings on this window. For example, if you always want to save the report layout with
the theme, check this box.
Change Layout Name?
Check this box to allow a new layout name to be saved. If you leave this box unchecked, the current report layout name
will be saved with any changes you have made.
Save It
Press this button to write the current changes to the Default.TFT theme file.
Press the OK button to maintain your current checkbox settings on this window, or press the Cancel button to reset them
to their original values.
216
Template Guide
The Tabs selection uses tab controls to signal the list box that a new sort order is to be applied. The Drop List option
populates a drop list control that contains the sort order selections of the selected Browse Box control. The Popup menu
option stores the sort order selections in a popup menu, which is accessed when right-clicking on the Browse Box (List
Box) control, or pressing the Sort Order button that is created. In addition, Popup menu enables the following additional
options for the Sort Order button:
Text
Enter the default text to display on the Sort Order button.
Icon
Enter an icon file or equate that you wish to use for the Sort Order button.
Cursor
Enter a default cursor file or equate that you wish to use for the Sort Order button. This cursor will be displayed when the
mouse moves over the button area.
HotKey
Enter a default hot key to use to automatically call the Sort Order button.
Message
Enter a default message to use for the Sort Order button. This text will appear by default in the window’s status bar.
Tip
Enter a tool tip message for the Sort Order button. This text will appear when the mouse is moved over the button.
Options
Activate the Flat check box to give the Sort Order button a flat appearance.
Activate the Skip check box to disable tabbing to the Sort Order button.
Select a Justification mode to designate where the icon (if any) will appear in relation to the button text.
217
Template Guide
Theme Design
Wizard Prompts
The Prompts buttons allow default settings to be established for the selected theme. Each prompt is described below.
Application
Control ModelWizard__Control_model
Reports
Check the Generate Reports for each file box to automatically generate report procedures for this selected theme.
Browse
Call Update Procedure
Check this box to allow this theme to always generate a Form (Update) procedure for each Browse that is generated.
Child Files
If the browse wizard is accessing a parent table, check this box to allow a button to be generated for each child file
defined in the Data Dictionary.
Parent File Handling
If the browse wizard is accessing a child table, you can specify how the browse will process the records:
Do not select by parent record
Do not limit the browse – browse all records.
218
Template Guide
Single Key
Select this option to force the wizard to generate a separate report for the key that you select in the Enter a key prompt
that follows.
Runtime Key Selection
Select this option to force the wizard to generate a single report that pops up a sort order dialog prior to printing at
runtime.
Record Order
Select this option to force the wizard to generate a single report sorted by record order for your selected file (or files).
Columns
How many columns do you want the report to use? Type the number of columns for your report. The Report Wizard
distributes the report columns evenly across the columns.
Customization:
Frame Customization
Form Customization
Process Customization
Browse Customization
Report Customization
Window Customization
219
Template Guide
Theme Selection
Theme From the drop down list, select an existing theme that you wish to add,
modify, or delete. If you are adding a new theme, you will need to select an
existing theme. After you make modification to the selected theme, you can
use the Save As option.
Report Layout From the drop down list, select an existing report layout that you wish to
add, modify, or delete. Changes to the Report Wizard will be applied to this
layout.
Operations
The buttons shown on this wizard sheet direct you to one of four operations. You can Design Theme, based on the
theme selected on the previous window. After your modifications, return to this window to Save Theme Default.TFT (the
selected theme), or Save As to a new theme name.
After saving the theme through one of the above methods, press the Cancel button to exit the wizard. Your theme is
already saved. You can also press the Finish button to exit the wizard, but you will have to complete the required entries
in the Save As dialog.
You can also remove the selected theme permanently by pressing the Delete Theme Default.TFT button.
220
Template Guide
Window Customization
Window
Name
Enter a name to use as the default caption, or title, for all windows generated.
Background
Enter a default image here to use as a graphic or watermark for your Window procedure control area.
Mode
If you have designated a background image to use for your Window procedure, this option becomes available to control if
the displayed image is tiled, stretched, or centered.
Icon
Enter a default icon to use for your Window procedure. This will allow your window to be minimized if needed.
Font
Press the Font button to select a default font to use for the Window procedure. Sample text shown below the button is
provided to allow you to review your selection.
Position
Select from the drop list to designate the initial position of your window. You can optionally center the window, or use the
default position that is set by the template wizard.
In addition, click on the System Menu check box to add the Windows System Menu to your Window procedure. If you will
be using any special entry control pictures on the window, you can also click on the Entry Patterns check box to allow the
display of special formatting picture information (Example: phone numbers or date pictures)
Buttons
The Window Wizard has three optional buttons that you can choose to populate. They are the OK, Cancel and Help
button controls. Check on each "Enable name button" box to activate the appropriate button dialogs. More information on
each button’s prompts are located here.
221
Additional Libraries and Templates
This section references additional libraries and templates that are not a part of the ABC Library or standard shipping
templates:
Crystal Report Templates
Crystal8 Class
Finance Library
HTML Help Templates - Overview
MenuStyleManager Class
Rich Text Template Support - Overview
Statistics Library
223
Template Guide
Files to Distribute
To distribute an application that includes the Crystal Report interface, the following files must be distributed.
C70cr8.dll Crystal DLL
This DLL file must be included in distribution when an application is compiled using the Standalone
(C70RUNx.DLL) Run-Time library.
The Crystal Reports Print Engine is now considered a legacy API and will no longer expose calls for any the new features
included in Crystal Reports. For more information, see "Retired Developer APIs" in Crystal Reports Developer's Guide
(CrystalDevHelp.chm).
224
Additional Libraries and Templates
225
Template Guide
PreviewCrystalReport
PrintCrystalReport
GetCrystalFormulaPreview
GetCrystalFormulaPrint
GetCrystalQueryPreview
GetCrystalQueryPrint
SetCrystalFormulaPreview
SetCrystalFormulaPrint
SetCrystalQueryPreview
SetCrystalQueryPrint
226
Additional Libraries and Templates
GetCrystalFormulaPreview / GetCrystalFormulaPrint
The GetCrystalFormulaPreview and GetCrystalFormulaPrint templates both accomplish the exact same task.
They retrieve the Formula that is used to limit retrieved records. The difference between these two templates is
that GetCrystalFormulaPreview is used in conjunction with the PreviewCrystalReport template and
GetCrystalFormulaPrint is used in conjunction with the PrintCrystalReport template.
These templates call the Crystal8.SelectionFormula method.
Requirements
These templates require the PreviewCrystalReport or the PrintCrystalReport template respectively.
Populating the Template
1. From an embed point, press the Insert button and select either the GetCrystalFormulaPreview or
GetCrystalFormulaPrint template.
Template Prompts
These templates provides the following prompts:
Target Variable
Specify a valid variable to store the retrieved Formula. This may be a STRING, CSTRING, PSTRING, or
MEMO data type. The variable may be a local, module, or global variable. You may also use a file field;
however, you must write the code to update the file. This variable is required.
GetCrystalQueryPreview / GetCrystalQueryPrint
The GetCrystalQueryPreview and GetCrystalQueryPrint templates both accomplish the exact same task. They
retrieve the SQL Query that is sent to the SQL data source. The difference between these two templates is that
GetCrystalQueryPreview is used in conjunction with the PreviewCrystalReport template and
GetCrystalQueryPrint is used in conjunction with the PrintCrystalReport template.
These templates call the Crystal8.Query method. For more information on these methods refer to the ABC Library
Reference, Crystal8 class.
Requirements
There templates require the PreviewCrystalReport or the PrintCrystalReport template respectively.
Populating the Template
1. From an embed point, press the Insert button and select either the GetCrystalQueryPreview or
GetCrystalQueryPrint template.
Template Prompts
These templates provides the following prompts:
Target Variable
Specify a valid variable to store the retrieved SQL query. This may be a STRING, CSTRING, PSTRING,
or MEMO data type. The variable may be a local, module, or global variable. You may also use a file field;
however, you must write the code to update the file. This variable is required.
227
Template Guide
PreviewCrystalReport
This template allows for previewing and printing of predefined Crystal Reports.
Requirements
There are no requirements for this template.
Populating the Template
1. From an embed point, press the Insert button and select the PreviewCrystalReport template.
Template Prompts
The PreviewCrystalReport template provides the following prompts:
General
Object Name
Set the object's label for the template-generated code. By fine-tuning the object names, you can make
your generated code easier to read. The default object name is oCrystal8.
Report Name or variable (prefixed with !)
Type a valid Crystal report name including extension (.rpt) or a variable that will contain the report name.
When using a variable, precede it with an exclamation (!). The report name must include the runtime path
of the file. If the file is not found at runtime an error window will display containing the following error-
"error opening job".
Window Title or variable (prefixed with !)
Crystal Reports are run inside a Clarion window. Type a title to appear in the window caption bar or enter
a variable name which will contain the window title. When using a variable, precede it with an exclamation
(!).
Show Print Controls?
Check this box to turn off all preview window buttons. If checked, the Control Options template tab will
not be available.
Control Options
This tab will not show if the Show Print Controls? option on the General tab is not checked.
Allow Prompting?
Check this box to allow the Crystal Report use its defined runtime parameter fields.
Allow Drill Down?
Check this box to allow support of Crystal's drill-down report feature.
Show Cancel Button?
Check this box to enable a Cancel button on the report preview window.
Show Close Button?
Check this box to enable a Close button on the report preview window.
Show Export Button?
Check this box to enable an Export button on the report preview window.
Show Launch Button?
Check this box to enable a Launch button on the report preview window. The Launch button runs the
Analysis tool.
Show Navigation Buttons?
Check this box to enable page navigation buttons on the report preview window.
Show Print Button?
Check this box to enable a Print button on the report preview window.
Show Print Setup?
Check this box to enable a PrintSetup button on the report preview window.
228
Additional Libraries and Templates
Show Progress?
Check this box to enable the report progress controls in the preview window. These controls include Total
Records, Records Read, Percent Read.
Show Refresh?
Check this box to enable a Refresh button on the report preview window.
Show Search?
Check this box to enable the two search controls on the report preview window. These two controls
include a search button and an entry control.
Show Zoom?
Check this box to enable the zoom control on the report preview window.
Show Toolbar Tips?
Check this box to enable tool tips on the toolbar in the preview window.
Show Document Tips?
Check this box to enable tool tips on the document (report) in the preview window.
Window Options
Initial State
Select the initial size and state of your window from the drop-down list. Choose from:
Normal Display the window at the default size. If you don't specify a default size, Clarion's run-time library
sets it for you.
Maximized This window fills the entire desktop, or the entire application frame, depending on whether the
window is an application window, or an MDI child window.
Iconized The window appears in an iconized state in the Taskbar.
Frame Type
Pick the frame type for your window from the drop-down list. Choose from:
Single A single pixel frame that the user cannot resize. Most suitable for dialog boxes.
Double A thick frame, which the user cannot resize. Use this type frame for a system modal window (without
a caption bar), or for a modal dialog box (with a caption bar).
Resizable A thick frame, which the user may resize. Choose this for application and MDI child windows.
None A single pixel frame. Most suitable for dialog boxes. The user cannot resize this frame.
Icon
To associate an icon with the window (and add a system menu—see System Menu below), specify an
icon file name (.ICO file) in this field. Type the file name or press the ellipsis button (...) to select a file
name with the standard Open File dialog. Specifying an icon automatically places a minimize button on
the caption bar of your application or MDI child window.
System Menu
To place a system menu in your window, check the System Menu box, or specify an icon file (see Icon
above), or specify a maximize box (see Maximize below). When your window has the SYSTEM attribute
Windows 95/98 and Windows NT display an icon in the upper left corner. If you specify an icon (see Icon
above), that icon displays, otherwise the system default icon displays. Initially, the system default icon is
set to the Clarion icon; however, you can specify a system default icon with:
System{PROP:Icon} = ‘My.ico’
Activate the system menu by CLICKING the button, box, or icon in the upper left corner of the window.
Standard system menu choices include Restore, Minimize, Maximize, and Close.
Every application frame should have a system menu. For users on a system without a mouse, the system
menu provides the only means of minimizing, maximizing or re-sizing the application window.
229
Template Guide
Maximize Box
To place a maximize button in your window (and a system menu—see System Menu above), check this
box. In general, you should place a maximize button on application windows and MDI child document
windows, not on dialog boxes.
3D Look
To provide the gray window background, and chiseled control look for your window, check this box. This
is clearly a style consideration, but will go a long way in giving your application a professional look.
230
Additional Libraries and Templates
PrintCrystalReport
This template allows for printing of predefined Crystal Reports. The report cannot be previewed with this template.
An optional printer setup dialog is available.
Requirements
There are no requirements for this template.
Populating the Template
1. From an embed point, press the Insert button and select the PrintCrystalReport template.
Template Prompts
The PrintCrystalReport template provides the following prompts:
Object Name
Set the object's label for the template-generated code. By fine-tuning the object names, you can make
your generated code easier to read. The default object name is oCrystal8.
Report Name or variable (prefixed with !)
Type a valid Crystal report name including extension (.rpt) or a variable that will contain the report name.
When using a variable, precede it with an exclamation (!). The report name must include the runtime path
of the file. If the file is not found at runtime an error window will display containing the following error-
"error opening job".
Number of Copies or variable
Specify the number of copies to print as a hard coded numeric value or specify a variable (prefixed with !)
to set the number of copies at runtime.
Show Printer Setup?
Check this box to show the printer setup dialog before the report is sent to the printer. This allows the
user to select a specific printer and set printer properties.
231
Template Guide
SetCrystalFormulaPreview / SetCrystalFormulaPrint
The SetCrystalFormulaPreview and SetCrystalFormulaPrint templates both accomplish the exact same task.
They set the Formula that is used to limit retrieved records. The difference between these two templates is that
SetCrystalFormulaPreview is used in conjunction with the PreviewCrystalReport template and
SetCrystalFormulaPrint is used in conjunction with the PrintCrystalReport template.
These templates call the Crystal8.SelectionFormula method. For more information on these methods refer to the
ABC Library Reference, Crystal8 class.
Requirements
There templates require the PreviewCrystalReport or the PrintCrystalReport template respectively.
Populating the Template
1. From an embed point, press the Insert button and select either the SetCrystalFormulaPreview or
SetCrystalFormulaPrint template.
Template Prompts
These templates provides the following prompts:
Formula Variable
Specify a valid variable that holds the Formula to send to the report. This variable may be a STRING,
CSTRING, PSTRING, or MEMO data type. The variable may be a local, module, or global variable. You
may also use a file field. This variable is required.
232
Additional Libraries and Templates
SetCrystalQueryPreview / SetCrystalQueryPrint
The SetCrystalQueryPreview and SetCrystalQueryPrint templates both accomplish the exact same task. They
set the SQL Query that wiil be sent to the SQL data source. The difference between these two templates is that
SetCrystalQueryPreview is used in conjunction with the PreviewCrystalReport template and
SetCrystalQueryPrint is used in conjunction with the PrintCrystalReport template.
These templates call the Crystal8.Query method. For more information on these methods refer to the ABC Library
Reference, Crystal8 class.
Requirements
These templates require the PreviewCrystalReport or the PrintCrystalReport template respectively.
Populating the Template
1. From an embed point, press the Insert button and select either the SetCrystalQueryPreview or
SetCrystalQueryPrint template.
Template Prompts
These templates provides the following prompts:
Query Variable
Specify a valid variable that holds the SQL Query to send to the SQL data source. This may be a
STRING, CSTRING, PSTRING, or MEMO data type. The variable may be a local, module, or global
variable. You may also use a file field. This variable is required.
233
Template Guide
Crystal8 Class
Business Object’s Crystal Reports is one of the leading report writers delivering Windows reports. For more information
on this product, visit the Business Objects web site at www.businessobjects.com.
Clarion’s Crystal Report interface is comprised of templates, libraries, and DLLs that communicate with Crystal Reports,
version 8 or 9. The DLL is accessed by a Class Interface and is hooked to your application using simple standard
Clarion code. This interface allows a seamless integration of previously defined Crystal reports within a Clarion
application. The Crystal report engine accesses data and creates the report. The report can be previewed in a Clarion
window.
Clarion’s Crystal Reports implementation is compatible with both the ABC and Legacy templates. It can only be used in
32-bit applications.
234
Additional Libraries and Templates
Crystal8 Methods
235
Template Guide
AllowPrompt(| allowpromptflag |)
Example:
oCrystal8.AllowPrompt(1)
CanDrillDown(| candrilldown |)
Example:
oCrystal8.CanDrillDown(1)
236
Additional Libraries and Templates
HasCancelButton (| hascancelbutton |)
Example:
oCrystal8.HasCancelButton(1)
HasCloseButton (| hasclosebutton |)
Example:
oCrystal8.HasCloseButton(1)
237
Template Guide
HasExportButton (| hasexportbutton |)
Example:
oCrystal8.HasExportButton(1)
HasLaunchButton (| haslaunchbutton |)
Example:
oCrystal8.HasLaunchButton(1)
238
Additional Libraries and Templates
HasNavigationControls (| hasnavigationcontrols |)
hasnavigationcontrols An integer constant, variable, EQUATE, or expression that specifies whether the navigation
controls will appear on the report’s preview window. A value of one (1) displays the
navigation controls; a value of zero (0) does not display the navigation controls.
The HasNavigationControls method is used to optionally display navigation controls on the report preview window. This
method returns a BYTE representing the value of hasnavigationcontrols. Navigation controls are used to navigate through
a report, immediately to the beginning, end or anywhere in between.
Example:
oCrystal8.HasNavigationControls(1)
HasPrintButton (| hasprintbutton |)
Example:
oCrystal8.HasPrintButton(1)
239
Template Guide
HasPrintSetupButton (| hasprintsetupbutton |)
Example:
oCrystal8.HasPrintSetupButton(1)
HasProgressControls (| hasprogresscontrols |)
Example:
oCrystal8.HasProgressControls(1)
240
Additional Libraries and Templates
HasRefreshButton (| hasrefreshbutton |)
Example:
oCrystal8.HasRefreshButton(1)
HasSearchButton (| hassearchbutton |)
Example:
oCrystal8.HasSearchButton(1)
241
Template Guide
HasZoomControl (| haszoomcontrol |)
Example:
oCrystal8.HasZoomControl(1)
Init (reportname)
Example:
oCrystal8.Init( ReportPathName )
Kill
The Kill method shuts down the Crystal8 object, releasing any memory allocated durring the lifetime of the object.
Example:
oCrystal8.Kill()
242
Additional Libraries and Templates
Example:
oCrystal8.Preview( 'My Report','I','R',,0,1,1 )
243
Template Guide
Example:
oCrystal8._Print( 1, 1 )
Query( | querystring |)
Example:
formula = oCrystal8.Query()!retrieve query into formula variable
formula = '{{Customer.Country} in ["Australia"]' ! SQL query
oCrystal8.Query( formula ) ! Set the query
244
Additional Libraries and Templates
SelectionFormula(| formulastring |)
Example:
formula = oCrystal8.SelectionFormula()!retrieve selection formula into formula variable
formula = '{{Customer.Country} in ["Australia"]' ! SQL query
oCrystal8.SelectionFormula( formula ) ! Set the query
ShowDocumentTips(| showdocumenttips |)
Example:
oCrystal8.ShowDocumentTips(1)
245
Template Guide
ShowReportControls (| showreportcontrols |)
Example:
oCrystal8.ShowReportControls(1)
ShowToolbarTips(| showtooltips |)
Example:
oCrystal8.ShowToolBarTips(1)
246
Additional Libraries and Templates
Finance Library
AMORTIZE (amortize loan for specific number of payments)
APR (annual percentage rate)
COMPINT (compound interest)
CONTINT (continuous compounding interest)
DAYS360 (days difference based on 360-day year)
FV (future value)
IRR (internal rate of return)
NPV (net present value)
PERS (periods of annuity)
PREPERS (periods of annuity with prepayment)
PMT (payment of annuity)
PREFV (future value with prepayment)
PREPMT (payment of annuity with prepayment)
PREPV (present value with prepayment)
PV (present value)
RATE (rate of annuity)
PRERATE (rate of annuity with prepayment)
SIMPINT (simple interest)
247
Template Guide
AMORTIZE(balance,rate,payment,totalpayments,principal,interest,endbalance)
rate A numeric constant or variable containing the periodic interest rate applied for a
single period.
principal The label of a DECIMAL variable to receive the portion of the payment(s)
applied to pay back the loan (a negative number).
interest The label of a DECIMAL variable to receive the portion of the payment(s)
applied towards loan interest (a negative number).
endbalance The label of a DECIMAL variable to receive the remaining loan balance.
The AMORTIZE procedure shows precisely which portion of a loan payment, or payments, constitutes interest and which
portion constitutes repayment of the principal amount borrowed. The computed amounts are based upon a loan balance
(balance), a periodic interest rate (rate), the payment amount (payment) and the number of payments (totalpayments).
The remaining balance (endbalance) is also calculated.
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
The return parameters principal, interest, and endbalance must be DECIMAL values (passed by value).
Internal Formulas:
248
Additional Libraries and Templates
Example:
Principal DECIMAL(18,2)
Interest DECIMAL(18,2)
EndingBalance DECIMAL(18,2)
CODE
249
Template Guide
APR(rate,periods)
periods A numeric constant or variable containing the number of compounding periods per
year.
The APR function determines the effective annual rate of interest based upon the contracted interest rate (rate) and the
number of compounding periods (periods) per year. For example, periods = 2 results in semi-annual compounding. The
contracted interest rate is a "non-compounded annual interest rate."
Internal Formulas:
Example:
250
Additional Libraries and Templates
COMPINT(principal,rate,periods)
principal A numeric constant or variable containing the beginning balance, initial deposit, or
loan.
rate A numeric constant or variable containing the applied interest rate for the given
time frame.
periods A numeric constant or variable containing the number of compounding periods per
year.
The COMPINT function computes total interest based on a principal amount (principal), an applied interest rate (rate),
plus the number of compounding periods (periods). The computed amount includes the original principal plus the
compound interest earned. Periods specifies the number of compounding periods. For example, periods = 2 results in
semi-annual compounding.
Applied interest rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
AppliedRate = PeriodicRate * TotalPeriods
Internal Formulas:
Example:
CASE FIELD()
OF ?OK
CASE EVENT()
OF EVENT:Accepted
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100) ! Setup Variables
ActualRate = PeriodicRate * TotalPeriods
CompoundInterest = COMPINT(Principal,ActualRate,TotalPeriods) ! Call COMPINT
DO SyncWindow
END
251
Template Guide
CONTINT(principal,rate)
principal A numeric constant or variable containing the beginning balance, initial deposit, or
loan.
rate A numeric constant or variable containing the applied interest rate for the given
time frame.
CONTINT computes total continuously compounded interest based on a principal amount (principal) and an applied
interest rate (rate). The returned amount includes the original principal plus the interest earned. Applied interest rate may
be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
AppliedRate = PeriodicRate * TotalPeriods
Example:
252
Additional Libraries and Templates
DAYS360(startdate,enddate)
DAYS360 determines the number of days difference between a beginning date (startdate) and an ending date (enddate),
based on a 360-day year (30 day month). Both date parameters MUST contain Clarion standard date values.
Internal Formulas:
Example:
DaysDifference = DAYS360(StartDate,EndDate)
253
Template Guide
FV (future value)
FV(presentvalue,periods,rate,payment)
presentvalue A numeric constant or variable containing the present value of the investment.
periods A numeric constant or variable containing the number of periods in which a cash
flow occurred.
FV and PREFV determine the future value of an initial amount (presentvalue) plus an income stream. The income stream
is defined as the total number of periods (periods), the periodic interest rate (rate), and a payment amount (payment). If
payments occur at the beginning of each period, use the PREFV function, which takes into account the added interest
earned on each period's payment.
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
Internal Formulas:
254
Additional Libraries and Templates
IRR(investment,cashflows,periods,rate)
investment A numeric constant or variable containing the initial cost of the investment (a
negative number).
cashflows[] A single dimensioned DECIMAL array containing the amounts of money paid out
and received during discrete accounting periods.
periods[] A single dimensioned DECIMAL array containing period numbers identifying the
discrete accounting periods in which cash flows occurred.
rate A numeric constant or variable containing the desired periodic rate of return.
IRR determines the rate of return on an investment (investment). The result is computed by determining the rate that
equates the present value of future cash flows to the cost of the initial investment. The cashflows parameter is an array of
money paid out and received during the course of the investment. The periods parameter is an array which contains the
period number in which a corresponding cash flow occurred. The desired periodic rate of return (rate) for the investment is
also specified. Investment should contain a negative number (a cost).
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
Cashflows and periods MUST both be DECIMAL arrays of single dimension and equal size. The last element in the
periods array MUST contain a zero to terminate the IRR analysis.
Internal Formulas:
The IRR function performs binary search iterations to home in on the return value. If more than 50 such iterations are
required, a value of zero is returned.
Example:
CashFlows DECIMAL(18,2),DIM(1000)
CashFlowPeriods DECIMAL(4),DIM(1000)
InvestmentAmount DECIMAL(18,2)
DesiredInterestRate DECIMAL(31,15)
255
Template Guide
Return DECIMAL(10,6)
InvestmentTransactions FILE,DRIVER('TOPSPEED'),|
NAME('busmath\!InvestmentTransactions'),PRE(INV),CREATE,THREAD
KeyIdPeriodNumber KEY(INVTRN:Id,INVTRN:PeriodNumber),NOCASE,PRIMARY
Notes MEMO(1024)
Record RECORD,PRE()
Id DECIMAL(8)
PeriodNumber DECIMAL(8)
Date ULONG
Type STRING(20)
Amount DECIMAL(16,2)
END
END
CODE
256
Additional Libraries and Templates
NPV(investment,cashflows,periods,rate)
investment A numeric constant or variable containing the initial cost of the investment (a
negative number).
cashflows[] A single dimensioned DECIMAL array containing the amounts of money paid out
and received during discrete accounting periods.
periods[] A single dimensioned DECIMAL array containing period numbers identifying the
discrete accounting periods in which cash flows occurred.
Rate A numeric constant or variable containing the desired periodic rate of return.
NPV determines the viability of an investment proposal by calculating the present value of future returns, discounted at
the marginal cost of capital minus the cost of the investment (investment). The cashflows parameter is an array of money
paid out and received during the course of the investment. The periods parameter is an array which contains the period
number in which a corresponding cash flow occurred. The desired periodic rate of return (rate) for the investment is also
specified. Investment should contain a negative number (a cost).
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
Cashflows and periods MUST both be DECIMAL arrays of single dimension and equal size. The last element in the
periods array MUST contain a zero to terminate the NPV analysis.
Return Data Type: DECIMAL
Internal Formulas:
Example:
CashFlows DECIMAL(18,2),DIM(1000)
CashFlowPeriods DECIMAL(4),DIM(1000)
InvestmentAmount DECIMAL(18,2)
DesiredInterestRate DECIMAL(31,15)
NetValue DECIMAL(18,2)
InvestmentTransactions FILE,DRIVER('TOPSPEED'),|
257
Template Guide
NAME('busmath\!InvestmentTransactions'),PRE(INV),CREATE,THREAD
KeyIdPeriodNumber KEY(INVTRN:Id,INVTRN:PeriodNumber),NOCASE,PRIMARY
Notes MEMO(1024)
Record RECORD,PRE()
Id DECIMAL(8)
PeriodNumber DECIMAL(8)
Date ULONG
Type STRING(20)
Amount DECIMAL(16,2)
END
END
CODE
258
Additional Libraries and Templates
PERS(presentvalue,rate,payment,futurevalue)
PERS Computes the number of periods required to reach a targeted future value.
presentvalue A numeric constant or variable containing the present value of the investment.
futurevalue A numeric constant or variable containing the amount of the desired or targeted
future value of the investment.
PERS determines the number of periods required to reach a desired amount (futurevalue) based upon a starting amount
(presentvalue), a periodic interest rate (rate), and a payment amount (payment). If payments occur at the beginning of
each period, use the PREPERS function, which takes into account the added interest earned on each period's payment.
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
If the present value is less than the future value (annuities), payments are positive, and conversely, if the present value is
greater than the future value (loans), payments are negative.
259
Template Guide
Internal Formulas:
The PERS function performs binary search iterations to home in on the periods value. If more than 50 such iterations are
required, a value of zero is returned.
Example:
260
Additional Libraries and Templates
PMT(presentvalue,periods,rate,futurevalue)
presentvalue A numeric constant or variable containing the amount of the present value of the
investment.
futurevalue A numeric constant or variable containing the amount of the desired or targeted
future value of the investment.
PMT determines the payment required to reach a desired amount (futurevalue) based upon a starting amount
(presentvalue), a total number of periods (periods), and a periodic interest rate (rate). If payments occur at the beginning
of each period then use the PREPMT function, which takes into account the added interest earned on each period's
payment.
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
If the present value is less than the future value (annuities), payments are positive, and conversely, if the present value is
greater than the future value (loans), payments are negative.
Internal Formulas:
261
Template Guide
Example:
262
Additional Libraries and Templates
PREPMT(presentvalue,periods,rate,futurevalue)
presentvalue A numeric constant or variable containing the amount of the present value of
the investment.
futurevalue A numeric constant or variable containing the amount of the desired or targeted
future value of the investment.
PREPMT determines the payment required to reach a desired amount (futurevalue) based upon a starting amount
(presentvalue), a total number of periods (periods), and a periodic interest rate (rate). If payments occur at the end of
each period then use the PMT function, which calculates interest accordingly.
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
If the present value is less than the future value (annuities), payments are positive, and conversely, if the present value is
greater than the future value (loans), payments are negative.
Internal Formulas:
263
Template Guide
PREFV(presentvalue,periods,rate,payment)
presentvalue A numeric constant or variable containing the present value of the investment.
FV and PREFV determine the future value of an initial amount (presentvalue) plus an income stream. The income stream
is defined as the total number of periods (periods), the periodic interest rate (rate), and a payment amount (payment). If
payments occur at the beginning of each period then use the PREFV function, which takes into account the added interest
earned on each period's payment.
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
Internal Formulas:
Example:
264
Additional Libraries and Templates
PREPERS(presentvalue,rate,payment,futurevalue)
PREPERS Computes the number of periods required to reach a targeted future value.
presentvalue A numeric constant or variable containing the present value of the investment.
PREPERS determines the number of periods required to reach a desired amount (futurevalue) based upon a starting
amount (presentvalue), a periodic interest rate (rate), and a payment amount (payment). If payments occur at the end of
each period, use the PERS function, which calculates interest accordingly.
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
If the present value is less than the future value (annuities), payments are positive, and conversely, if the present value is
greater than the future value (loans), payments are negative.
265
Template Guide
Internal Formulas:
The PREPERS function performs binary search iterations to home in on the periods value. If more than 50 such iterations
are required, a value of zero is returned.
Example:
266
Additional Libraries and Templates
PRERATE(presentvalue,periods,payment,futurevalue)
PRERATE Computes the periodic interest rate required to reach a targeted future value.
presentvalue A numeric constant or variable containing the present value of the investment.
periods A numeric constant or variable containing the number of periods in which a cash
flow occurred.
futurevalue A numeric constant or variable containing the amount of the desired or targeted
future value of the investment.
PRERATE determines the periodic interest rate required to reach a desired amount (futurevalue) based upon a starting
amount (presentvalue), the total number of periods (periods), and a payment amount (payment). If payments occur at the
end of each period then use the RATE function, which calculates interest accordingly.
If the present value is less than the future value (annuities), payments are positive, and conversely, if the present value is
greater than the future value (loans), payments are negative.
Internal Formulas:
The PRERATE function performs binary search iterations to home in on the interest rate value. If more than 50 such
iterations are required, RATE returns a value of zero.
267
Template Guide
Example:
268
Additional Libraries and Templates
PREPV(periods,rate,payment,futurevalue)
PREPV Computes the present value required to reach a targeted future value.
periods A numeric constant or variable containing the number of periods in which a cash
flow occurred.
futurevalue A numeric constant or variable containing the amount of the desired or targeted
future value of the investment.
PREPV determines the present value required today to reach a desired amount (futurevalue) based upon the total
number of periods (periods), a periodic interest rate (rate), and a payment amount (payment). If payments occur at the
end of each period then use the PV function, which calculates interest accordingly.
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
If the present value is less than the future value (annuities), payments are positive, and conversely, if the present value is
greater than the future value (loans), payments are negative.
Internal Formulas:
269
Template Guide
PV (present value)
PV(periods,rate,payment,futurevalue)
periods A numeric constant or variable containing the number of periods in which a cash
flow occurred.
futurevalue A numeric constant or variable containing the amount of the desired or targeted
future value of the investment.
PV determines the present value required today to reach a desired amount (futurevalue) based upon the total number of
periods (periods), a periodic interest rate (rate), and a payment amount (payment). If payments occur at the beginning of
each period then use the PREPV function, which takes into account the added interest earned on each period's payment.
Periodic rate may be calculated as follows:
PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)
If the present value is less than the future value (annuities), payments are positive, and conversely, if the present value is
greater than the future value (loans), payments are negative.
Internal Formulas:
270
Additional Libraries and Templates
RATE(presentvalue,periods,payment,futurevalue)
RATE Computes the periodic interest rate required to reach a targeted future value.
presentvalue A numeric constant or variable containing the present value of the investment.
periods A numeric constant or variable containing the number of periods in which a cash
flow occurred.
futurevalue A numeric constant or variable containing the amount of the desired or targeted
future value of the investment.
RATE determines the periodic interest rate required to reach a desired amount (futurevalue) based upon a starting
amount (presentvalue), the total number of periods (periods), and a payment amount (payment). If payments occur at the
beginning of each period then use the PRERATE function, which takes into account the added interest earned on each
period's payment.
If the present value is less than the future value (annuities), payments are positive, and conversely, if the present value is
greater than the future value (loans), payments are negative.
Internal Formulas:
The RATE function performs binary search iterations to home in on the interest rate value. If more than 50 such iterations
are required, RATE returns a value of zero.
271
Template Guide
Example:
272
Additional Libraries and Templates
SIMPINT(principal,rate)
principal A numeric constant or variable containing the beginning balance, initial deposit, or
loan.
rate A numeric constant or variable containing the simple or contract interest rate.
SIMPINT determines an interest amount based solely on a given amount (principal) and the simple interest rate (rate).
The amount returned ONLY reflects interest earned.
Internal Formulas:
SIMPLE INTEREST = principal * rate
Example:
273
Template Guide
274
Additional Libraries and Templates
275
Template Guide
This check box also makes it possible to have a WinHelp and HTML Help project maintained by the same
application. The HTML Help template will strip out the leading tilde (~) from a WinHelp ID.
There is also a Utility template that will generate all HTML Help Ids to an output text file. See: ListHLPIds Utility
Template.
Allow STD:Help on buttons to call HTML Help
Check this box if you wish to redirect the standard call for all buttons that use the STD:Help STD ID from a
WinHelp (.HLP) file to the HTML help file named by the template. Clear this box if you need to have a dual-
help application.
Allow STD:HelpIndex to call HTML Help Index
Check this box if you wish to redirect the standard call on any menu item or button that use the STD:HelpIndex
STD ID from a WinHelp (.HLP) file to the Index of the HTML help file named by the template.
Allow STD:HelpSearch on buttons to call HTML Help Search
Check this box if you wish to redirect the standard call on any menu item or button that uses the
STD:HelpSearch STD ID from a WinHelp (.HLP) file to the Search tab of the HTML help file named by the
template.
Allow STD:HelponHelp on buttons to call HTML Help on…
Check this box if you wish to redirect the standard call on any menu item or button that uses the
STD:HelponHelp STD ID from a WinHelp (.HLP) file to the Help on… section of the HTML help file named by
the template.
Alternate 'TRAP' Key
Ordinarily the F12 (the trap key) or the F1 key initiates the call to an HTML help file. The trap key can be
changed by entering the equate for the new keystroke to initiate the call to the help file. This allows
developers who use the F12 for other reasons can continue to do so. You can also override this global trap
key on the procedure level.
276
Additional Libraries and Templates
277
Template Guide
278
Additional Libraries and Templates
Template Prompts:
Variable to receive the Help Topic
Specifies a variable to receive the current help topic. Use the ellipsis (…) to select the variable from the field list or
type in a variable name that already exists.
279
Template Guide
Template Prompts:
Key word to search for
Specify the Keywords(s) to search for. A string or variable may be specified. Multiple keywords can be searched
for by entering a list of Keywords separated by semicolons (;) as the string to search for. If a variable is used, the
variable should contain a list of keywords separated by semicolons. This entry is required.
String message to display if not found (opt)
Specifies the message to display in a message box if the Keyword is not found. This entry is optional.
Title for Message box (opt)
Specifies the title of the message box dialog. This entry is optional.
280
Additional Libraries and Templates
Template Prompts:
There are no prompts for this code template.
281
Template Guide
MenuStyleManager Class
The MenuStyle Manager class is designed to provide a simple interface to the XP Visual Styles currently available for
standard menus.
Template Implementation
The MenuStyleManager class is supported by the core templates in the Global Properties App Settings. This template
instantiates an object based on a default MenuStyleMgr object name. The object is instantiated in the procedure where
the application’s main Frame exists.
282
Additional Libraries and Templates
MenuStyleManager Properties
MenuFEQ LONG,PROTECTED
The MenuFEQ property holds the active MENUBAR Field Equate Number.
Implementation:
The MenuFEQ property is assigned to the MenuInterface Interface in the InitMenuInterface method.
283
Template Guide
MenuStyleManager Methods
284
Additional Libraries and Templates
AlignShortcutsToLeft( value )
value An optional BYTE value used to position any menu shortcuts. The default value is 1.
The AlignShortcutsToLeft method is used to left align the menu shortcuts or hot keys specified. These shortcuts always
appear to the right of the menu text. This method is used to simply determine how they are aligned. If value is zero (0), the
shortcuts are right aligned.
Implementation:
The method is not called anywhere within the MenuStyleManager Class. It is an optional method that can be used by the
developer to detect and possibly change the alignment of menu shortcuts at runtime.
See Also: AreShortcutsLeftAligned ( detect left aligned menu shortcuts )
AreShortcutsLeftAligned( ), BYTE
The AreShortcutsLeftAligned method is used to detect if the shortcut of any menu are left aligned, If the return value is
TRUE (1), the menu shortcuts are left aligned. Otherwise, if the function returns FALSE (0), they are right aligned.
Implementation:
The method is not called anywhere within the MenuStyleManager Class. It is an optional method that can be used by the
developer to detect and possibly change the alignment of menu shortcuts at runtime.
Return Data Type: BYTE
See Also: AlignShortcutsToLeft ( position menu shortcuts to left )
285
Template Guide
MenuPart A BYTE value representing a specific area of the menu. There are a series of
internal equates available to easily identify these elements:
The GetEndColor method is used to retrieve the ending color of any MenuPart. The ending color represents the finishing
color of any menu gradient, and is represented by a LONG integer.
Implementation:
This method is used by the SetVerticalGradient method to determine the ending color of the specific vertical color
gradient to apply.
Return Data Type: LONG
See Also: SetVerticalGradient ( set vertical color gradient )
286
Additional Libraries and Templates
GetFlatMode( ), BYTE
The GetFlatMode method is used to detect if a menu is currently using a flat mode appearance. If the method returns
TRUE (1), flat mode is active.
Implementation:
The method is not called anywhere within the MenuStyleManager Class. It is an optional method that can be used by the
developer to detect and possibly change the flat mode menu appearance at runtime.
Return Data Type: BYTE
See Also: SetFlatMode( set menu flat mode )
GetFont(*FontName,*FontSize,*FontStyle,*FontCharSet,*FontAngle,*FontColor)
The GetFont method is used to return the font characteristics for the active menu bar. The returned values are assigned
to a set of internally referenced values:
FontName *CSTRING,RAW
FontSize SIGNED
FontStyle DWORD
FontCharSet BYTE
FontAngle LONG
FontColor COLORREF
Implementation:
The method is not called anywhere within the MenuStyleManager Class. It is an optional method that can be used by the
developer to detect and possibly change the menu font at runtime.
See Also: SetFont ( set menu text font)
287
Template Guide
MenuPart A BYTE value representing a specific area of the menu. There are a series of
internal equates available to easily identify these elements:
The GetImage method is used to return the image name of a specified ManuPart.
Implementation:
The method is not called anywhere within the MenuStyleManager Class. It is an optional method that can be used by the
developer to detect and possibly change the menu appearance by specifying an image for a target menu area at runtime.
Return Data Type: STRING
See Also: SetImage ( apply image to menu part )
288
Additional Libraries and Templates
MenuPart A BYTE value representing a specific area of the menu. There are a series of
internal equates available to easily identify these elements:
The GetIsVerticalGradient method is used to detect that a target MenuPart is using a vertical gradient.
Implementation:
The method is not called anywhere within the MenuStyleManager Class. It is an optional method that can be used by the
developer to detect and possibly change the menu appearance by specifying a vertical gradient at runtime.
Return Data Type: BYTE
See Also: SetVerticalGradient ( set vertical color gradient)
289
Template Guide
MenuPart A BYTE value representing a specific area of the menu. There are a series of
internal equates available to easily identify these elements:
The GetStartColor method is used to retrieve the starting color of any MenuPart. The starting color represents the initial
color of any menu gradient, and is represented by a LONG integer.
Implementation:
This method is used by the SetVerticalGradient method to determine the starting color of the specific vertical gradient to
apply.
Return Data Type: LONG
See Also: SetVerticalGradient ( set vertical color gradient)
290
Additional Libraries and Templates
MenuTextType A BYTE value representing a specific type of menu text to color. There are a
series of internal equates available to easily identify these elements:
MenuColors:NormalText EQUATE(1)
MenuColors:SelectedText EQUATE(2)
MenuColors:HotText EQUATE(3)
MenuColors:InactiveText EQUATE(4)
The GetTextColor method gets a color for the specified MenuTextType. It returns a LONG integer representing the 32-bit
color used.
Implementation:
The method is not called anywhere within the MenuStyleManager Class. It is an optional method that can be used by the
developer to detect and possibly change the menu text color at runtime.
Return Data Type: STRING
See Also: SetTextColor( get menu text color )
291
Template Guide
Init( MenuFEQ )
MenuStyleMgr.Init(?MenuBar)
MenuStyleMgr.SetFlatMode(False)
MenuStyleMgr.SetColor(MenuBrushes:ImageBkgnd,-2147483644,-2147483644)
MenuStyleMgr.SetColor(MenuBrushes:SelectedBkgnd,8388608,8388608,False)
MenuStyleMgr.SetColor(MenuBrushes:SelectedBarBkgnd,8388608,8388608,True)
MenuStyleMgr.SetColor(MenuBrushes:HotBkgnd,8388608,8388608,True)
MenuStyleMgr.SetColor(MenuBrushes:FrameBrush,8388608, 8388608,True)
DISPLAY()
292
Additional Libraries and Templates
InitMenuInterface()
The InitMenuInterface is a protected method that is used to initialize several menu components of the target menu used
to apply a selected visual style. These components include the Menu Field Equate Label, Style, Flat Mode, Colors and
Brush style.
Implementation:
The protected InitMenuInterface method is called by the Init method of the instantiated MenuStyleManager class, and is
called prior to assigning any XP Menu Style.
See Also: Init (initialize the MenuStyleManager object)
293
Template Guide
MenuHasGradient(MenuPart), BYTE
MenuPart A BYTE value representing a specific area of the menu. There are a series of
internal equates available to easily identify these elements:
The MenuHasGradient method is used to detect if a gradient color is applied to a specified target MenuPart. If the
method returns TRUE, a gradient color is currently in use.
Implementation:
This method is currently not implemented by the MenuClassManager object, but is available to the developer if manual
processing of any MENUBAR is preferred.
Return Data Type: BYTE
See Also: SetColor ( specify color for menu part )
294
Additional Libraries and Templates
MenuInterface &IMenuInterface
IMenuInterface INTERFACE,COM
295
Template Guide
MenuStyle &IMenuStyle
The MenuStyle is a PROTECTED reference to the IMenuStyle interface declared in CWINI,INT as follows:
IMenuStyle INTERFACE,COM
Clone PROCEDURE (),*IMenuStyle
Destroy PROCEDURE ()
SetDirty PROCEDURE ()
MenuFont PROCEDURE (),*IFontProperties
MenuBrush PROCEDURE (UNSIGNED),*IBrush !Index: MenuBrushes
MenuColor PROCEDURE (UNSIGNED, COLORREF) !Index: MenuColors
MenuColor PROCEDURE (UNSIGNED),COLORREF !Index: MenuColors
FlatMode PROCEDURE (UNSIGNED) !Value: FlatMenuMode
FlatMode PROCEDURE (),UNSIGNED !Value: FlatMenuMode
AlignShortcuts PROCEDURE (BOOLEAN)
AlignShortcuts PROCEDURE (),BOOLEAN ! TRUE: Shortcuts are left aligned
END
Implementation:
The MenuStyle interface is implemented through the InitMenuInterface method, and is used to hold the active menu style
of the current application. The interface methods described above are used to modify various characteristics of the target
menu structure.
See Also: InitMenuInterface(initialize menu properties)
296
Additional Libraries and Templates
Color1 A LONG value that represents a valid RGB composite color to be mixed with the
second color (color1)
Color2 A LONG value that represents a valid RGB composite color to be mixed with the
first color (color1)
percentage A BYTE value that represents the percentage of mix applied to the two colors.
The MixColors method is a PROTECTED method used to calculate and return a composite mix of two colors with a given
percentage of mix.
Each color passed to this method is a RGB composite color extracted as follows:
InputColor LONG
RGBT1 GROUP,OVER(InputColor)
R BYTE
G BYTE
B BYTE
NotUsed BYTE
END
The mixing of colors is applied using the following formula to all RGB elements:
Implementation:
The MIxColors method is used by the SetThemeColors method to detect and set the proper theme menu style color
based on the active theme detected.
297
Template Guide
MenuPart A BYTE value representing the area of the menu to color. There is a series of
internal equates available to easily identify these elements:
StartColor A LONG integer that specifies a starting color to use. If a gradient is active, this
represents the starting color of the menu gradient.
EndColor A LONG integer that specifies a starting color to use. If a gradient is active, this
represents the finishing color of the menu gradient.
vertical An optional BYTE value that specifies the direction of the color gradient. When
TRUE (1), the direction of the gradient color is vertical. Otherwise, if omitted or
False, the gradient is horizontal.
The SetColor method is used to set a specific color gradient to a specified part of the active menu. In general, you may
modify any individual part of a menu as specified by the MenuPart parameter, however most styles are a group of menu
elements assigned to produce a specific look. See the example below for an illustration.
Implementation:
The SetColor method can be applied anytime after the Init method for the target menu has been executed.
Example:
MenuStyleMgr.SetColor(MenuBrushes:SelectedBkgnd,15331781,16764861,False)
MenuStyleMgr.SetColor(MenuBrushes:SelectedBarBkgnd,15331781,16760187,True)
MenuStyleMgr.SetColor(MenuBrushes:HotBkgnd,15331781,16764861,True)
MenuStyleMgr.SetColor(MenuBrushes:FrameBrush,12615680, 12615680,True)
298
Additional Libraries and Templates
SetFlatMode( mode )
mode A BYTE value that sets the menu flat mode. A value of TRUE (1) turns flat mode on,
and a value of FALSE (0) turns it off.
The SetFlatMode method controls the flat mode appearance of a target menu. When flat mode is off (FALSE), the
selection bar appears "raised" in the menu structure. Otherwise the appearance of the selection bar is "flat".
Implementation:
The method is usually called right after the Init method, and prior to setting menu colors.
Example:
MenuStyleMgr.Init(?MenuBar)
MenuStyleMgr.SetFlatMode(False)
MenuStyleMgr.SetColor(MenuBrushes:ImageBkgnd,12632256,12632256)
MenuStyleMgr.SetColor(MenuBrushes:SelectedBkgnd,12632256,12632256,False)
MenuStyleMgr.SetColor(MenuBrushes:SelectedBarBkgnd,12632256,12632256,True)
MenuStyleMgr.SetColor(MenuBrushes:HotBkgnd,12632256,12632256,True)
MenuStyleMgr.SetColor(MenuBrushes:FrameBrush,8421504, 8421504,True)
DISPLAY()
299
Template Guide
FontSize An integer constant or variable containing the size (in points) of the font. If
omitted, the system default font size is used.
FontAngle An integer constant or constant expression that specifies the amount of rotation,
in tenths of degrees. If positive, the angle is measured counter-clockwise from
the report's horizontal orientation. Valid values are between 3600 and -3600
FontColor A LONG integer constant or variable containing the red, green, and blue values
for the color of the font in the low-order three bytes, or an EQUATE for a
standard Windows color value. If omitted, black is used.
The SetFont method is used to set the default font used for the active MENUBAR.
Implementation:
The method is not called anywhere within the MenuStyleManager Class. It is an optional method that can be used by the
developer to detect and possibly change the menu font at runtime.
Return Data Type: STRING
See Also: GetFont( get menu text font)
300
Additional Libraries and Templates
MenuPart A BYTE value representing a specific area of the menu. There are a series of
internal equates available to easily identify these elements:
ImageName A string constant or variable containing the name of the file to display.
The SetImage method is used to apply a valid image to a target MenuPart, This method is generally used to replace any
color gradient assignment with a more complex color image of watermark.
Implementation:
The method is not called anywhere within the MenuStyleManager Class. It is an optional method that can be used by the
developer to detect and possibly change the menu appearance by specifying an image for a target menu area at runtime.
See Also: GetImage ( get image name assigned to menu part )
301
Template Guide
MenuTextType A BYTE value representing a specific type of menu text to color. There are a
series of internal equates available to easily identify these elements:
MenuColors:NormalText EQUATE(1)
MenuColors:SelectedText EQUATE(2)
MenuColors:HotText EQUATE(3)
MenuColors:InactiveText EQUATE(4)
TextColor A LONG integer that specifies a text color to use. There are approximately
4294967296 different colors in the 32-bit library.
302
Additional Libraries and Templates
SetThemeColors( )
The SetThemeColors method is used to detect the active theme and set a Menu Style method to automatically match it.
Implementation:
The SetThemeColors method is not used by the MenuStyleManager class, but was created to allow the developer to
easily apply an automatic Menu Style under program control.
If an active theme is not detected, the Windows Classic Menu Style is automatically applied.
Example:
303
Template Guide
MenuPart A BYTE value representing a specific area of the menu. There are a series of
internal equates available to easily identify these elements:
vertical An optional BYTE value that specifies the direction of the color gradient. When
TRUE (1), the direction of the gradient color is vertical. Otherwise, if omitted or
False, the gradient is horizontal.
The SetVerticalGradient method is used to designate that any colors applied to the target MenuPart will be in a vertical
direction.
Implementation:
The method is not called anywhere within the MenuStyleManager Class. It is an optional method that can be used by the
developer to detect and possibly change the menu appearance by specifying a vertical gradient at runtime. It should be
called prior to the SetColor method.
Return Data Type: STRING
See Also: GetStartColor (get starting gradient color), GetEndColor (get ending gradient color), SetColor ( specify
color for menu part )
304
Additional Libraries and Templates
Statistics Library
FACTORIAL (factorial of a number)
FREQUENCY (frequency count of an item in a set)
LOWERQUARTILE (lower quartile value of a set)
MEAN (mean of a set)
MEDIAN (median of a set)
MIDRANGE (midrange of a set)
MODE (mode of a set)
PERCENTILE (pth percentile value of a set)
RANGEOFSET (range of a set)
RVALUE (linear regression correlation coefficient)
SS (sum of squares)
SSXY (sum of squares for x and y)
ST1 (student's t for a single mean)
SDEVIATIONP (standard deviation of a population)
SDEVIATIONS (standard deviation of a sample)
SUMM (summation of a set)
UPPERQUARTILE (upper quartile value of a set)
VARIANCEP (variance of a population)
VARIANCES (variance of a sample)
305
Template Guide
FACTORIAL(number)
The FACTORIAL function implements the standard factorial formula. For example, if the number provided is 5 then the
function returns the value of: (1 x 2 x 3 x 4 x 5) = 120.
X = 5
FactorialOfX = FACTORIAL(X) !call FACTORIAL
306
Additional Libraries and Templates
FREQUENCY(dataset,searchvalue)
FREQUENCY Counts the number of instances of a particular value within a numeric set.
dataset The label of a QUEUE with its first component field defined as a REAL.
searchvalue A numeric constant or variable containing the value to search for in the
QUEUE.
FREQUENCY counts the number of instances of a particular value (searchvalue) within a numeric set (dataset). The
function operates on the numeric set defined by all the entries in the first component of the designated QUEUE (dataset).
For example, given the data set: [1,2,2,3,4,5] and the search value 2, the function would return a frequency count of 2.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
StatSetX QUEUE,PRE()
X REAL
END
FrequencyOfX REAL
SearchValue REAL(1)
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
FrequencyOfX = FREQUENCY(StatSetX,SearchValue) !call FREQUENCY to search Q
307
Template Guide
LOWERQUARTILE(dataset)
LOWERQUARTILE Returns the median of the lower half of an ordered numeric data set.
Dataset The label of a QUEUE with its first component field defined as a REAL.
LOWERQUARTILE computes a value such that at most 25% of a numeric set's values are less than the computed value,
and at most 75% of the set's values are greater than the computed value. The function operates on the numeric set
defined by all the entries in the first component of the designated QUEUE (dataset). For example, given the data set:
[1,2,3,4,5,6,7,8] the lower quartile value is 2.5.
In general, the LOWERQUARTILE function is only meaningful when the number of elements in the data set is large (ie.
greater than 20).
See also:
PERCENTILE, UPPERQUARTILE.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetX QUEUE,PRE()
X REAL
END
LowerQuartileOfSet REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
LowerQuartileOfSet = LOWERQUARTILE(StatSetX) !call LOWERQUARTILE
308
Additional Libraries and Templates
MEAN(dataset)
dataset The label of a QUEUE with its first component field defined as a REAL.
MEAN computes the arithmetic average of a set. The arithmetic average is the sum of a set's values divided by the
number of elements in the set. The function operates on the numeric set defined by all the entries in the first component of
the designated QUEUE (dataset).
For example, if the set contains 5 values: [1,2,3,4,5] then the mean is (1+2+3+4+5) / 5 = 3.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Example:
StatSetX QUEUE,PRE()
X REAL
END
MeanOfSet REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
MeanOfSet = MEAN(StatSetX) !call MEAN
309
Template Guide
MEDIAN(dataset)
dataset The label of a QUEUE with its first component field defined as a REAL.
MEDIAN finds the value which is exactly in the middle when all of the data is in (sorted) order from low to high, or the
mean of the two data values which are nearest the middle. The function operates on the numeric set defined by all the
entries in the first component of the designated QUEUE (dataset).
For example, given the data set: [1,2,3,4,5] the median is 3, or given the data set: [1,2,4,5] the median is (2 + 4) / 2 = 3.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Example:
StatSetX QUEUE,PRE()
X REAL
END
MedianOfSet REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
MedianOfSet = MEDIAN(StatSetX) !call MEDIAN
310
Additional Libraries and Templates
MIDRANGE(dataset)
MIDRANGE Returns the average of the highest and lowest value in a numeric set.
dataset The label of a QUEUE with its first component field defined as a REAL.
MIDRANGE computes the mean of the smallest and largest values in a data set. The function operates on the numeric
set defined by all the entries in the first component of the designated QUEUE (dataset).
For example, given the data set: [1,2,3,4,5] the midrange is (1 + 5) / 2 = 3.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Example:
StatSetX QUEUE,PRE()
X REAL
END
MidrangeOfSet REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
MidrangeOfSet = MIDRANGE(StatSetX) !call MIDRANGE
311
Template Guide
MODE(dataset,modeset)
MODE Identifies the value(s) that occurs most often in a numeric set and returns the
number of times it occurs.
dataset The label of a QUEUE with its first component field defined as a REAL.
modeset The label of a QUEUE with its first component field defined as a REAL.
MODE determines which value or values within a numeric set occurs most often. The value or values are then stored in
the passed QUEUE (modeset), and the function returns the number of occurrences (mode count).
The function operates on the numeric set defined by all the entries in the first component of the designated QUEUE
(dataset). Modeset must be a QUEUE with the first component defined as a REAL variable. The contents of the modeset
QUEUE are freed upon entry to the function.
For example, given the data set: [5,5,7,7,9] the returned mode count is 2 and the modeset QUEUE would contain two
separate entries: 5 and 7.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetX QUEUE,PRE()
X REAL
END
ModeSet QUEUE,PRE()
ModeValue REAL
END
ModeCount REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
ModeCount = MODE(StatSetX,ModeSet) !call MODE
312
Additional Libraries and Templates
PERCENTILE(dataset,percentile)
PERCENTILE Returns a value that divides an ordered numeric data set into two portions of
specified relative size.
dataset The label of a QUEUE with its first component field defined as a REAL.
percentile A numeric constant or variable containing an integer value in the range: 1 >= p
<= 99 .
PERCENTILE computes a value such that at most pth% of the set's values are less than the amount, and at most 100 -
pth% of the set's values are greater than the amount. The function operates on the numeric set defined by all the entries
in the first component of the designated QUEUE (dataset).
For example, given the data set: [1,2,3,4,5,6], the 50th Percentile value is 3.5.
In general, the PERCENTILE function is only meaningful when the number of elements in the data set is large (ie. greater
than 20).
See also:
LOWERQUARTILE
UPPERQUARTILE.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
313
Template Guide
Example:
StatSetX QUEUE,PRE()
X REAL
END
PercentileOfX REAL
DividePoint REAL(90)
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
PercentileOfX = PERCENTILE(StatSetX,DividePoint) !call PERCENTILE
314
Additional Libraries and Templates
RANGEOFSET(dataset)
RANGEOFSET Returns the difference between the largest and smallest values in a numeric
set.
dataset The label of a QUEUE with its first component field defined as a REAL.
RANGEOFSET computes the difference between the largest and smallest values in a numeric set. The function operates
on the numeric set defined by all the entries in the first component of the designated QUEUE (dataset).
For example, given the data set: [1,2,3,4,5], the range is (5 - 1) = 4.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetX QUEUE,PRE()
X REAL
END
RangeOfSetX REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
RangeOfSetX = RANGEOFSET(StatSetX) !call RANGEOFSET
315
Template Guide
RVALUE Returns the correlation coefficient of the linear relationship between the paired
data points in the data set.
dataset The label of a QUEUE with its first two component fields defined as REAL. The
first component contains the set of X values and the second component contains
the set of Y values.
meanX A numeric constant or variable containing the average of the X values (optional).
meanY A numeric constant or variable containing the average of the Y values (optional).
RVALUE computes the correlation coefficient of the linear relationship between the paired data points in the data set. The
function operates on the numeric sets defined by all the entries in the first two components of the designated QUEUE
(dataset).
The optional parameters help to optimize the function. If not provided, the value(s) are computed internally by the
function.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetXY QUEUE,PRE()
X REAL
Y REAL
END
CorrelationCoefficient REAL
CODE
FREE(StatSetXY) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetXY:X = STADAT:X !load the QUEUE buffer
StatSetXY:Y = STADAT:Y !load the QUEUE buffer
ADD(StatSetXY) !add to the QUEUE
END
END
CorrelationCoefficient = RVALUE(StatSetXY) !call RVALUE
316
Additional Libraries and Templates
SS (sum of squares)
SS(dataset [,meanofset])
SS Returns the sum of the squared differences between each data set value and the
data set's mean.
dataset The label of a QUEUE with its first component field defined as a REAL.
meanofset A numeric constant or variable representing the average of the data set's values
(optional).
SS computes the sum of the squared differences between each data set value and the data set's mean. The function
operates on the numeric set defined by all the entries in the first component of the designated QUEUE (dataset). The
computation is a significant factor in several statistical formulas.
The optional parameter helps to optimize the function. If not provided, the mean value is computed internally by the
function.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetX QUEUE,PRE()
X REAL
END
SumOFSquaresX REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
SumOFSquaresX = SS(StatSetX) !call SS
317
Template Guide
SSXY Returns the sum of the products of the differences between each data point and its
associated (either X or Y) mean value.
dataset The label of a QUEUE with its first two component fields defined as REAL. The first
component contains the set of X values and the second component contains the set
of Y values.
meanX A numeric constant or variable containing the average of the X values (optional).
meanY A numeric constant or variable containing the average of the Y values (optional).
SSXY computes the sum of the products of the differences between each data point and its associated (either X or Y)
mean value. The function operates on the numeric sets defined by all the entries in the first two components of the
designated QUEUE (dataset). The computation is a significant factor in linear regression formulas.
The optional parameters help to optimize the function. If not provided, the value(s) will be computed internally by the
function.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetXY QUEUE,PRE()
X REAL
Y REAL
END
SumOfSquares REAL
CODE
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetXY:X = STADAT:X !load the QUEUE buffer
StatSetXY:Y = STADAT:Y !load the QUEUE buffer
ADD(StatSetXY) !add to the QUEUE
END
END
SumOfSquares = SSXY(StatSetXY) !call SSXY
318
Additional Libraries and Templates
ST1(dataset,hypothesizedmean)
ST1 Returns the Student's t value for a given data set and hypothesized
mean value.
Dataset The label of a QUEUE with its first component field defined as a REAL.
ST1 computes the Student's t value for a given data set and hypothesized mean value. The function operates on the
numeric set defined by all the entries in the first component of the designated QUEUE (dataset). The returned t value is
used in a statistical test of an hypothesis about a normally distributed population based on a small sample.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetXY QUEUE,PRE()
X REAL
END
TValue REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
TValue = ST1(StatSetX,HypothesizedMean) !call ST1
319
Template Guide
SDEVIATIONP(dataset [,meanofset])
SDEVIATIONP Returns the standard deviation of the entire population of a numeric set.
dataset The label of a QUEUE with its first component field defined as a REAL.
meanofset A numeric constant or variable representing the average of the data set's
values (optional).
SDEVIATIONP computes the standard deviation of a given population data set. SDEVIATIONS computes the standard
deviation of a given sample data set. The 'Population' function call should be used only if the data set contains all of a
population's values. The function operates on the numeric set defined by all the entries in the first component of the
designated QUEUE (dataset).
The optional parameter helps to optimize the function. If not provided, the value is computed internally by the function.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetXY QUEUE,PRE()
X REAL
END
StandardDeviation REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
StandardDeviation = SDEVIATIONP(StatSetX) !call SDEVIATIONP
320
Additional Libraries and Templates
SDEVIATIONS(dataset [,meanofset])
dataset The label of a QUEUE with its first component field defined as a REAL.
meanofset A numeric constant or variable representing the average of the data set's
values.
SDEVIATIONP computes the standard deviation of a given population data set. SDEVIATIONS computes the standard
deviation of a given sample data set. The 'Sample' function call should be used only if the data set contains less than all of
a population's values. The function operates on the numeric set defined by all the entries in the first component of the
designated QUEUE (dataset).
The optional parameter helps to optimize the function. If not provided, the value is computed internally by the function.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetXY QUEUE,PRE()
X REAL
END
StandardDeviation REAL
321
Template Guide
SUMM(dataset)
dataset The label of a QUEUE with its first component field defined as a REAL.
SUMM computes the summation of all of a data set's values. The function operates on the numeric set defined by all the
entries in the first component of the designated QUEUE (dataset). The computation is a significant factor in several
statistical formulas.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetXY QUEUE,PRE()
X REAL
END
SummationOfSet REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
SummationOfSet = SUMM(StatSetX) !call SUMM
322
Additional Libraries and Templates
UPPERQUARTILE(dataset)
Returns the median of the upper half of an ordered numeric data set.
UPPERQUARTILE
Dataset The label of a QUEUE with its first component field defined as a REAL.
UPPERQUARTILE computes a value such that at most 75% of the set's values are less than the amount, and at most
25% of the set's values are greater than the amount. The function operates on the numeric set defined by all the entries in
the first component of the designated QUEUE (dataset).
For example, given the data set: [1,2,3,4,5,6,7,8] the upper quartile value is 6.5.
In general, the UPPERQUARTILE function is only meaningful when the number of elements in the data set is large (ie.
greater than 20).
See also:
LOWERQUARTILE, PERCENTILE.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetXY QUEUE,PRE()
X REAL
END
UpperQuartileOfSet REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
UpperQuartileOfSet = UPPERQUARTILE(StatSetX) !call UPPERQUARTILE
323
Template Guide
VARIANCEP(dataset [,meanofset])
dataset The label of a QUEUE with its first component field defined as a REAL.
meanofset A numeric constant or variable representing the average of the data set's
values (optional).
VARIANCEP computes the variance of a given population data set. VARIANCES computes the variance of a given
sample data set. The 'Population' function call should be used only if the data set contains all of a population's values. The
function operates on the numeric set defined by all the entries in the first component of the designated QUEUE (dataset).
The optional parameter helps to optimize the function. If not provided, the value is computed internally by the function.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetXY QUEUE,PRE()
X REAL
END
VarianceOfSet REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
VarianceOfSet = VARIANCEP(StatSetX) !call VARIANCEP
324
Additional Libraries and Templates
VARIANCES(dataset [,meanofset])
dataset The label of a QUEUE with its first component field defined as a REAL.
meanofset A numeric constant or variable representing the average of the data set's values
(optional).
VARIANCES computes the variance of a given sample data set. VARIANCEP computes the variance of a given
population data set. The 'Sample' function call should be used only if the data set contains less than all of a population's
values. Both functions operate on on the numeric set defined by all the entries in the first component of the designated
QUEUE (dataset).
The optional parameter helps to optimize the function. If not provided, the value is computed internally by the function.
The passed data set does not have to be sorted. The function copies the passed set. The passed data set is unchanged.
Return DataType: REAL
Example:
StatSetXY QUEUE,PRE()
X REAL
END
VarianceOfSet REAL
CODE
FREE(StatSetX) !free the QUEUE
CLEAR(STADAT:RECORD) !clear the record buffer
STADAT:Id = STA:Id !prime the record buffer
STADAT:ItemNumber = 1
SET(STADAT:KeyIdItemNumber,STADAT:KeyIdItemNumber !position file pointer
LOOP !load the QUEUE
NEXT(StatisticsData) !read next record
IF ERRORCODE() OR STADAT:Id NOT = STA:Id
BREAK
ELSE
StatSetX:X = STADAT:X !load the QUEUE buffer
ADD(StatSetX) !add to the QUEUE
END
END
VarianceOfSet = VARIANCES(StatSetX) !call VARIANCES
325
Template Guide
326
Index
Index
_Print print a Crystal Report ........................................ 244 Browse Procedure Wizard .......................................... 182
Aborted Add/Change ................................................... 171 Browse QBE List Control Template ............................ 109
Add ADO File Extension ................................................. 7 Browse Select button control template ....................... 112
Additional Libraries and Templates .....................223, 224 Browse Update buttons control template .................... 113
Additional Sort Fields Dialog ........................................... 5 Browse Wizard ............................................................ 182
ADO Browse Box Select Button .................................... 84 BrowseFuzzyMatching control template ..................... 103
ADO browse control ...................................................... 76 BrowseGrid ................................................................. 105
ADO Browse Procedure .............................................. 176 BrowseNoRecords Button control template ................ 108
ADO Browse Process Button ........................................ 84 BrowsePrintButton ...................................................... 106
ADO Browse Refresh Code Template .......................... 58 BrowsePublishButton .................................................. 107
ADO Browse Update Button control template ............... 85 BrowseQueryButton .................................................... 157
ADO Errors Object List Template.................................. 86 BrowseToHTML .......................................................... 107
ADO Form ................................................................... 176 BrowseToolbarControl ................................................ 112
ADO Login Controls Control Template ......................... 89 BrowseToolboxButton ................................................. 112
ADO Process Extension ................................................ 13 BrowseViewButton ...................................................... 116
ADO Process Pause Button .......................................... 86 Business Math Library248, 250, 251, 252, 253, 254, 255,
257, 259, 261, 263, 264, 265, 267, 269, 270, 271, 273,
ADO Process Procedure ............................................. 176
307, 308, 309, 310, 311, 312, 313, 315, 316, 317, 318,
ADO Report Procedure ............................................... 176 319, 320, 321, 322, 323, 324, 325
ADO Save Button Control Template ............................. 87 Button Customization .................................................. 198
ADO Support Template - Global Extension .................. 28 Calendar Button - Classes Tab................................... 118
ADO Support Templates ................ 76, 84, 85, 86, 87, 89 Calendar Button - General Tab................................... 117
AlignShortcutsToLeft position menu shortcuts to left .. 285 Calendar Button Control Template ............................. 116
AlinkLookUp ................................................................ 278 Call a Procedure Extended code template ................... 59
AMORTIZE .................................................................. 248 Call Procedure As Lookup code template .................... 60
application template ........................................................ 3 CallABCMethod ............................................................ 58
Application Wizard utility template .............................. 178 Cancel Button control template ................................... 120
APR ............................................................................. 250 ChangeRecord ................................................................ 1
AreShortcutsLeftAligned detect left aligned menu CleanCloseDown Global Extension .............................. 21
shortcuts ...................................................................... 285
Close Button control template ..................................... 120
ASCII Print Button control template .............................. 89
Close Current Window code template .......................... 60
ASCII Search Button control template .......................... 89
CloseHelp ................................................................... 279
ASCII View control template ......................................... 90
code templates...................................... 56, 60, 66, 67, 69
ASCII View in List box ................................................... 91
COMPINT ................................................................... 251
auto-size ........................................................................ 92
CONTINT .................................................................... 252
BLOBInControl Extension Template ............................. 20
Contract all .................................................................. 163
Browse Box ................................................................... 92
Control Customization ................................................ 199
Browse Customization ................................................ 196
327
Template Guide
328
Index
329
Template Guide
page number on a report ............................................. 163 Relation Tree Update buttons ..................................... 163
Pause Button Control template ................................... 153 relationships
Percentile .................................................................... 313 printing ........................................................................ 195
PERS ........................................................................... 259 relationships ................................................................ 195
PMT ............................................................................. 261 RelationTree control template ..................................... 160
Preemptive Procedure Extension.................................. 30 repetitive insert/add
PREFV ........................................................................ 264 field history key
PREPERS ................................................................... 265 ditto key
PREPMT ..................................................................... 263 repeating entries into fields ......................................... 171
PREPV ........................................................................ 269 repetitive insert/add..................................................... 171
PRERATE ................................................................... 267 Report Additions Customization ................................. 215
Preview preview a Crystal Report ............................... 243 Report Customization ................................................. 207
PreviewCrystalReport ................................................. 228 Report Label Customization ....................................... 212
PrintCrystalReport ....................................................... 231 Report Wizard ............................................................. 191
Printing ReportChildFiles ........................................................... 33
Data Dictionary ............................................................ 195 ReportDateStamp control template ............................ 163
Printing ........................................................................ 195 ReportPageNumber control template ......................... 163
procedure template ..................................................... 175 ReportTimeStamp control template ............................ 164
ProcedureCallTreeReport Utility Template ................. 189 Request and Response .................................................. 1
Process Control Customization ................................... 206 resize strategy
Process Customization ............................................... 205 for a single control......................................................... 39
Process Transaction Frame Checkpoint code template resize strategy............................................................... 39
...................................................................................... 67
ResizeSetStrategy ........................................................ 68
Process Transaction Frame extension template ........... 31
Rich Text Templates ................................................... 305
Process Wizard utility template ................................... 190
RTF Popup Menu translation ...................................... 165
ProcessRecord ................................................................ 1
RTFStatusBar Control Template ................................ 164
ProcessReportQBEButton .......................................... 154
RTFTextControl Control Template.............................. 165
program template ............................................................ 4
RTFToolBar Control Template .................................... 169
PV ................................................................................ 270
RunCommandLineProc ................................................ 34
QBE List ...................................................................... 109
RVALUE ...................................................................... 316
Query by Example ....................................................... 109
Save As Theme .......................................................... 216
Query retrieve or set the SQL data query ................... 244
Save Button control template ...................................... 171
RANGEOFSET............................................................ 315
Save Button Transaction Frame extension template .... 34
RATE ........................................................................... 271
Save Theme................................................................ 216
Rebase .......................................................................... 35
SaveRecord .................................................................... 1
Record Validation extension template .......................... 32
SDEVIATIONP ............................................................ 320
Refresh Window routine .................................................. 2
SDEVIATIONS ............................................................ 321
Relation Tree Expand Contract buttons ...................... 163
Select Embed Type....................................................... 56
330
Index
331