<<Templates: the Version 3.1 Set>>
Templates: the Version 3.1 Set

This set of Templates is the updated set for Clarion for DOS 3.1. If
you are importing applications from CPD 2.1 or creating new
applications, this is the Template set you should use. The 3.0
compatibility set is only provided for backward compatibility with
CDD 3.0.

Press the Sections button for specific information on the Templates
included in this set.

<<GLOBAL SETTINGS>>
GLOBAL SETTINGS

The information you provide in the prompt fields on the Global
Settings window are used throughout the application. These
affect source code generation for the Global CODE section of the
application, and the generated source code for all procedures.

<Properties>
Properties

<  Enable Mouse Support>
Enable Mouse Support

Check this box to indicate that the application will allow the
user to use a mouse.  This places a SETMOUSE(1,1) statement in
the Global CODE section.

<  Enhanced Background>
Enhanced Background

Check this box to indicate that the application will be run on
an EGA, VGA, or SVGA monitor which allows the Blink bit to be
used as background color Enhance bit (see SETNOBLINK in the
Language Reference).

<  Close Unused Files>
Close Unused Files

Check this box to indicate that each procedure should close the
data files which it opens.  When this box is checked,
CheckOpen() is generated as a FUNCTION returning one (1) if it
actually opened the file, or zero (0) if the file was already
open or unable to be opened. If not checked, CheckOpen is
generated as a PROCEDURE.

The return value from the CheckOpen() function is saved in a
local variable by each procedure.  That saved value is checked
just before RETURN to its calling procedure--if the procedure
opened the file, it also closes the file.

<  Add the EXTERNAL() Flag for Template Declared... Global Data>
Add the EXTERNAL() Flag for Template Declared... Global Data

Check this box to indicate that template generated internally
declared global variables (GlobalRequest, GlobalResponse, etc.)
have been declared in a referenced Library or .DLL and must have
the EXTERNAL attribute in this .EXE (or .DLL).

<  Declare Template Standard Functions As... External Functions>
Declare Template Standard Functions As... External Functions

Check this box so that ONLY the associated MAP prototypes are
generated into the global MAP structure for the template generated
functions (and procedures) listed below.  This means the function
definitions must exist in the main module of some externally
specified Library or DLL referenced by this APPlication.

3.0 and 3.1 Functions:

    CheckOpen
    DiskError
    ShowWarning
    ConfirmedProcess

2.1 Functions:

    G_OPENFILES
    G_OPENFILES2

IMPORTANT NOTE: If this check box is ON then the global check box
                'Close Unused Files' should be consistant with
                the setting in the APPlication which created the
                Library/DLL where the functions are defined.

If the check box is OFF then the function definitions, in addition
to the associated MAP prototypes, are generated into the main
module of an APPlication.

<  APPs Return Value>
APPs Return Value

If this prompt is filled out then the specified value (which
may be a numeric constant, a global variable, or numeric expression)
is returned to the calling process or DOS, else 0 is returned as the
default return value.

A calling process may query on the return value by use of the
RUNCODE() function.  A DOS batch file may query on the return
value by use of the IF ERRORLEVEL batch statement.

<  Intellidate Value>
Intellidate Value

Assign a value in the range -99 to +99 to control Intellidate logic
for dates in any date picture with a two-digit year.  This value is
assigned to the internal library's _IntelliDateValue variable which
controls the Intellidate logic.

The century for dates in any date picture with a two-digit year may
be resolved using Intellidate logic by setting an appropriate
Intellidate Value.  The Intellidate Value defaults to 0 in the
internal library which disables Intellidate logic.  With Intellidate
logic disabled, data entry into any date format picture with a two-
digit year defaults to the 1900 century.

An Intellidate Value in the range -99 to +99 (other than zero)
enables the Intellidate logic and changes the default century
interpretation for dates input with a two digit year.  A positive
or negative value determines the Intellidate "direction" (positive
indicates future and negative indicates past), for the Intellidate
computation.

For example, with the Intellidate Value set to +60, a picture @D1
specifies using the appropriate century for each year 60 years in
the future and 40 years in the past.  If the current year is 1996,
when the user enters "5/01/40," the date is in the year 2040, and
when the user enters "5/01/60," the date is in the year 1960.

For another example, with the Intellidate Value set to -80, if the
current year is 1996 and the date input is "9/2/59", the 59 means
1959 since 1959 falls between this year-80 years (1916) and this
year+19 years (2015).

When enabled, the Intellidate logic affects the following date
pictures:

  @D1    mm/dd/yy
  @D5    dd/mm/yy
  @D7    dd mmm yy
  @D9    yy/mm/dd
  @D11   yymmdd	
  @D13   mm/yy
  @D15   yy/mm

<  Program Author>
Program Author

Enter the programmer's name for documentation purposes.

<Compatibility...>
Compatibility...

This button calls a window that provides the following prompts
for Clarion for DOS version 3.0 compatibility.

<  CDD 3.0>
CDD 3.0

Check this box to enable the Enable Shared Files and If File Not
Found prompts. This will override any file settings made through
the Files button.

<  Enable Shared Files>
Enable Shared Files

Check this box to indicate that the application will be used in
a multi-user environment. This could be a Network, Multi- user
operating system, or a single- user Multi-tasking operating
system. When checked, all data files in the application are
OPENed in shared access mode 42h (Read/Write, Deny None) instead
of exclusive access mode 22h (Read/Write, Deny Write).

<  If File Not Found>
If File Not Found

Select the action to take when the application attempts to open
a non-existing data file. Create Attempt to CREATE the file.
Halt Display a warning then return to DOS.

Tip:    When using the 3.1 template set, use the Files button
instead of the Compatibility button. The Files button provides
better low-level control of the application's file settings.

<  CPD 2.1>
CPD 2.1

Check this box to enable the Global Action prompt.

<  Global Action>
Global Action

This provides compatibility for Clarion Professional Developer 2.1
imported applications by creating a global variable named Action.

Tip:    When importing 2.1 procedures into an application
        created with the 3.1 template set, delete the Action local
        variable from any Form procedures that contain it (compiler
        errors occur if you don't).

<GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) global
template settings.  The global 'GUI Settings' define the default
GUI settings for an application.

Local 'GUI Settings', which override the global settings, can be
defined for individual procedures by selecting the 'GUI Settings'
button on the appropriate 'Procedure Properties' screens.

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make an application's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source Code Points>
Embedded Source Code Points

<  Inside Global MAP>
Inside Global MAP

In the Global data section of the program at the end of the MAP
structure.  Use this point to declare any Global procedure
prototypes (or INCLUDE a file containing them) that the Application
Generator does not automatically include in the MAP.

<  Before File Declarations>
Before File Declarations

In the Global Data section of your program, after the MAP and
%GlobalData (data declared through the Data Button of Application
Properties), and before the file declarations. This source can be
used to declare any variables that you didn't declare as part of
%GlobalData, or variables that don't need to be visible in the
Application Generator.  The placement of this #EMBED allows the
declarations made here to be visible to your File Declarations.

For example, suppose you have twenty files, each of which uses a
variable as the file location.  You could either declare each
variable in the Global Data button, or use this EMBED to write one
declaration, copy it 20 times, and make the modifications to the
copies.

<  Data Section>
Data Section

In the Global data section of the program after Global data and all
data file definitions.  This may be used to declare any Global data
which you may want to use only in your embedded source code.

<  Setup Program>
Setup Program

Immediately after the CODE statement.

<  Before Return to DOS>
Before Return to DOS

After the call to the first procedure and immediately before the
RETURN statement which takes the user back to DOS.

<  CheckOpen: Setup Procedure>
CheckOpen: Setup Procedure

In the CheckOpen (either the PROCEDURE or FUNCTION) immediately
after the CODE statement.

<  CheckOpen: No Error>
CheckOpen: No Error

In the CheckOpen (either the PROCEDURE or FUNCTION) CASE ERRORCODE()
immediately following OF NoError (No Error Occurred).

<  CheckOpen: File Open Error>
CheckOpen: File Open Error

In the CheckOpen (either the PROCEDURE or FUNCTION) CASE ERRORCODE()
immediately following OF IsOpenErr (File Already Open).

<  CheckOpen: No File Error>
CheckOpen: No File Error

In the CheckOpen (either the PROCEDURE or FUNCTION) CASE ERRORCODE()
immediately following OF NoFileErr (File Not Found).

<  CheckOpen: Invalid File Error>
CheckOpen: Invalid File Error

In the CheckOpen (either the PROCEDURE or FUNCTION) CASE ERRORCODE()
immediately following OF InvalidFileErr (Invalid Record
Declaration).

<  CheckOpen: Bad Key Error>
CheckOpen: Bad Key Error

In the CheckOpen (either the PROCEDURE or FUNCTION) CASE ERRORCODE()
immediately following OF BadKeyErr (Key file must be rebuilt).

<  CheckOpen: Directly Before Return>
CheckOpen: Directly Before Return

In the CheckOpen (either the PROCEDURE or FUNCTION) CASE ERRORCODE()
immediately before the RETURN statement.

<  DiskErr: Setup Procedure>
DiskErr: Setup Procedure

In the DiskError FUNCTION immediately after the CODE statement.

<  DiskErr: Directly Before Return>
DiskErr: Directly Before Return

In the DiskError FUNCTION immediately before the RETURN statement.

<  ShowWarning: Setup Procedure>
ShowWarning: Setup Procedure

In the ShowWarning PROCEDURE immediately after the CODE statement.

<  ShowWarning: Before Screen Opening>
ShowWarning: Before Screen Opening

In the ShowWarning PROCEDURE immediately before the OPEN(Screen)
statement.

<  ShowWarning: After Accept>
ShowWarning: After Accept

In the ShowWarning PROCEDURE immediately after the ACCEPT statement.

<  ShowWarning: Directly Before Return>
ShowWarning: Directly Before Return

In the ShowWarning PROCEDURE immediately before the RETURN
statement.

<  ConfirmProcess: Setup Procedure>
ConfirmProcess: Setup Procedure

In the ConfirmedProcess FUNCTION immediately after the CODE
statement.

<  ConfirmProcess: Before Screen Opening>
ConfirmProcess: Before Screen Opening

In the ConfirmedProcess FUNCTION immediately before the OPEN(Screen)
statement.

<  ConfirmProcess: After Accept>
ConfirmProcess: After Accept

In the ConfirmedProcess FUNCTION immediately after the ACCEPT
statement.

<  ConfirmProcess: Directly Before Return>
ConfirmProcess: Directly Before Return

In the ConfirmedProcess FUNCTION immediately before the RETURN
statement.

<<THE BATCH TEMPLATE>>
THE BATCH TEMPLATE

The Batch template generates a procedure which loops through a file
and performs an operation on each record. This template is designed
to allow changing or deleting a group of records with no hand
coding.  However, there are many embedded source code points to give
the programmer maximum flexibility.

Tip: It is a very good idea to make a backup copy of your data files
     before running a batch Change or Delete and NEVER test these
     procedures on live data without first making a backup. Another
     good idea is to use a Report procedure to test Range Limits or
     Record Filters, then use the Change Templates option to create
     the Batch procedure after thorough testing.

<Formatter Support>
Formatter Support

The Screen Formatter contains a default screen design containing two
display fields, and Ok and Cancel buttons. The Pulldown Menu
Formatter and Report Formatter are not supported.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  Range Limit Field>
Range Limit Field

You can limit the range of records to process by fixing the value of
a component of the primary file access key.

For example, line items on an invoice can be limited to a single
invoice.  The key for the item file might contain ITM:Invoice and
ITM:Line containing the invoice number and line number of the item.
ITM:Invoice would be the Range Limit Field, displaying only those
records for a fixed invoice number.

The Range Limit Field is assigned the Range Value Field for this
limit.

<  Range Value Field>
Range Value Field

The Range Value Field is the field which holds the value to be used
as the limiting key component value. The key component is assigned
this value.

In this example, the current Invoice record might contain the number
of the invoice that is being displayed. INV:Number would be the
Range Value Field, supplying the value for the Range Limit Field.

The Range Value Field must not be the same field as the Range Limit
Field.

<  Record Filter>
Record Filter

Enter a record filter expression here. This filters the records so
that the specified action is performed on only thos records that
meet the filter criteria.

For example, if the Delete action is selected, and you enter
CUS:State = `FL' as the filter, then all customers with the state
code of `FL' will be deleted.

The expression you enter is not automatically checked_ an invalid
expression will generate compiler errors. If you are not familiar
with the Clarion language statements or expressions, use a Formula
field with the FILTER Formula Class instead.

<  Action for Batch>
Action for Batch

The batch process may either change or delete records. Change will
PUT each selected record. Delete will DELETE each selected record.
No Action will not PUT or DELETE the records, you must supply the
code for the action to perform.

<  Show Record Counter>
Show Record Counter

Check this box to display a record counter as the records are
changed or deleted. Displaying a variable on screen within the main
process LOOP can slow the batch process slightly. Therefore, you may
leave this check box blank and have no screen updates within the
LOOP.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source>
Embedded Source

<  Data Section>
Data Section

In the data section of the procedure after local data, the screen
and pulldown structures.  Use this point to declare any data which
you may want to use only in your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  Setup Screen>
Setup Screen

After the OPEN(Screen) statement.

<  Before file SET()>
Before file SET()

Before the SET statement which determines the file processing order.
This embedded source code point is the ideal place to fill key
values for a multiple component key SET.

<  Before LOOP>
Before LOOP

After the SET command but before the main LOOP. At this location you
may override the SET statement, or enter any LOOP setup code.

<  NEXT Record Error Check>
NEXT Record Error Check

Immediately after the NEXT statement. This allows a check of the
ERRORCODE() function to ensure that there were no errors.

<  Within LOOP>
Within LOOP

After the GET to any secondary files. This is the heart of the
processing LOOP.  If using a record filter, this code may not always
be executed if the record is filtered out. If Many to 1
relationships exist in the File Schematic, the lookups will have
already been done. Any formulas created with the formula formatter
(except FILTER) will have been executed just prior to this embedded
source code. The next statement which executes after this code is
the PUT or DELETE of the record if Change or Delete has been
selected for this batch.

<  PUT/DELETE Record Error Check>
PUT/DELETE Record Error Check

Immediately after the PUT or DELETE commands. This allows a check of
the ERRORCODE() function to ensure that there were no errors
replacing a record. If you are changing fields which are the
components of unique keys, or if you are running this batch process
on shared files, you may enter your own error handling scheme here.
If No Action was selected for this batch process, this embedded
source code point is not needed.

<  End of Procedure>
End of Procedure

Code placed in this embedded source code point executes after all
other code in the procedure has executed. This code begins in column
one, therefore you may use this window to write any ROUTINEs which
are called from any other embedded source code window.

<  When Screen Field is Selected>
When Screen Field is Selected

In the CASE SELECTED() structure, executed when the field is
selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the field has been
completed.

<Formula Classes        >
Formula Classes

<  FILTER>
FILTER

A Conditional Field with "FILTER" in the Formula Class field is used
to select which records are processed. If the Condition expression
evaluates to zero (false) for a given record, it is not processed.

<  GENERAL or No class (blank)>
GENERAL or No class (blank)

Calculates the formula every time a record is processed.

<<THE BROWSE TEMPLATE>>
THE BROWSE TEMPLATE

The Browse template generates a procedure to display records from a
data file in a List box. Each line in the List box displays fields
from one record of the data file. Each line in the List box can be
scrolled left or right using the arrow keys or the List box
horizontal scroll bar. The default Browse screen has Add, Change,
and Delete buttons which call an Update Procedure to allow users to
update a data file, and a Select button to allow users to select a
record from the list.  The Select button is dimmed unless the Browse
procedure is called as a lookup. Records are displayed in the List
box in KEY order. The KEY that is used is identified as the Access
Key  on the File Schematic dialog (accessed by the Files button).

The List box isn't filled with records until it is selected. You can
place Screen fields before the LIST box in the SCREEN structure
code, but the first page of records won't display until those fields
are completed and the List box is selected. Therefore, you should
place the LIST field first in the screen structure unless you want a
field to control the LIST in some manner. For example, an entry
field could be use to establish a value for a range limit or filter.
The Insert, Change, and Delete buttons, or any other field that
processes a record selected from the List box must be placed after
the LIST box in the Field List. To see the order in which Fields are
processed for your screen, enter the Screen Formatter and press
CTRL+F (when the cursor is not on a screen field) to bring up the
Field List. The Select button is activated if the Browse procedure
is called with GlobalRequest set equal to SelectRecord (an EQUATE).
This occurs when a Procedure is called from an entry field, from
either the When Field is Selected or When Field is Completed embed
points, AND you have named a Return Field.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  Record Filter>
Record Filter

Enter a valid Clarion language expression.  Record
filters are used to Browse a subset of the data file.
Each record from the data file is evaluated against this
expression for inclusion in this list. If you have a
range limit, each record within that limit is evaluated
instead. It is always preferable to use a range limit, if
possible.

<  Enable Total Embeds>
Enable Total Embeds

Check this box to use any of the following Embedded
Source points to calculate totals from the data file: Set
to First Record Before Total Loop, Inside Total
Loop, Immediately After Next(), Inside Total Loop,
or After Filter. Code is generated to read the data file,
and execute the embedded source code prior to
displaying the List box. To keep the total accurate
when a user adds, changes, or deletes a record, you
also need to add code to the Embed points: Prior to
Update Procedure, and After Update Procedure.

<  Locator Type>
Locator Type

A Locator field is used to position the highlight bar to
a particular section of the data file, using a the first
key field component of the Browse Access Key.  A
Locator field is already placed on the Browse Screen
by default as an ENTRY field after the LIST field.
Select the type of Locator field to use:

        None    No Locator field.

        Step    Takes the user to the first record that starts with
                that character. This is a single-character Locator;
                typing "S" goes to the first record starting with S,
                then typing "M" goes to the first record starting
                with M, etc.

        Normal  The user types as many characters as they choose,
                then the closest matching record is found after the
                user hits the TAB key. The Locator remains active
                while the Locator field is selected.

        Incremental
                Progressively selects the closest matching record
                each time the user enters a keystroke, getting to a
                closer match as the user types more characters. This
                is a multi-character Locator; typing "S" goes to the
                first record starting with S, Then typing "M" goes
                to the first record starting with SM, etc. This
                Locator remains active while the List box is
                selected.

    Note: If your Locator field is a Numeric field, you should add
          the `B' to the picture token, to blank if zero.

<  Disable Memo Access>
Disable Memo Access

Check this box ON if you want to disable memo access while browsing
through the primary file.  Typically, this optimizes browse
performance.

When ON, the NOMEMO() statement is generated for all browse accesses
to the primary file, however, when an update action or select action
is performed the memo(s) are properly accessed.

<  Range Limits ...>
Range Limits ...

This button contains the following prompts that relate
to defining the Range Limits for the Browse
procedure.

<     Range Limit Field>
Range Limit Field

Name a KEY field used to limit the records shown in
the List box.  The field must be a component of the
Browse Access Key.  Records are included in the
Browse if they have a KEY value which matches the
value of this field.

<     Range Limit Type>
Range Limit Type

Select the type of Range Limits to implement for the
procedure:

<            Current Value>
             Current Value

Use the value contained in the Range Limit Field at
the beginning of the procedure as the limiting value.

<            Single Value>
             Single Value

Use the value contained in the Range Value Field at
the beginning of the procedure as the limiting value.

<            Range of Values>
             Range of Values

Use the values contained in the Low Limit Value and
High Limit Value fields as the limiting values.

<    Range Limit Value>
Range Limit Value

For a Single Value Range Limit, this field names a
variable or constant value that the Range Limit Field
must equal.

<     Low Limit Value>
Low Limit Value

For a Range of Values Range Limit, this field names a
variable or constant value defining the lowest value
the Range Limit Field may equal.

<     High Limit Value>
High Limit Value

For a Range of Values Range Limit, this field names a
variable or constant value defining the highest value
the Range Limit Field may equal.

<  Update Procedure>
Update Procedure

This button contains the following prompts that relate
to defining the Update Procedure for the Browse
procedure.

<    Update Procedure>
Update Procedure

Names the procedure to call when the user presses the
Add, Change, or Delete buttons.

<    Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) which
may be required by the called Update procedure/function.  The
parameter list is appended to the generated Update procedure/
function call.

For example, if a called Update procedure MyUpdateProc requires
two parameters based on its prototype, then entering:

                    (Parm1,Parm2)

would result in the generation of the following call:

               MyUpdateProc(Parm1,Parm2)

NOTES: 1. The parentheses enclosing the parameter list are required.

       2. The 'Parameter List' and the 'Assign Return Value' prompt
          work together to construct the correct Update call.

<    Assign Return Value>
Assign Return Value

Specify a return value which will receive the return value from an
Update function.  If the called Update's prototype describes a
function then a variable to receive the return value should be
specified, otherwise, if the Update's prototype describes a
procedure then this entry must be blank.

The value is used to construct the update call, for example, if
the variable ReturnValue is specified for a Update function
MyUpdateFunc, then the following call would be generated:

                ReturnValue = MyUpdateFunc()

NOTE: The 'Parameter List' and the 'Assign Return Value' prompt
      work together to construct the correct Update call.

<    Restrict Inserts>
Restrict Inserts

Check this box to disallow calling the Update
Procedure to add records.

<    Insert Hot Key>
Insert Hot Key

Enter the keystroke that calls the Update Procedure to
add records.

<    Restrict Changes>
Restrict Changes

Check this box to disallow calling the Update
Procedure to change records.

<    Change Hot Key>
Change Hot Key

Enter the keystroke that calls the Update Procedure to
change records.

<    Restrict Deletes>
Restrict Deletes

Check this box to disallow calling the Update
Procedure to delete records.

<    Delete Hot Key>
Delete Hot Key

Enter the keystroke that calls the Update Procedure to
delete records.

<  Compatibility...>
Compatibility...

This button calls a window that provides the following
prompts for compatibility with the version 3.0
Lookup, Validate, and Select Templates. These 3.0
Templates perform data entry validation before
opening the screen.

<    Procedure Type>
Procedure Type

Select the 3.0 Template to emulate:

       None        Stays as a 3.1 Browse.

       Validate    Emulates the 3.0 Validate Template, performing
                   data entry validation before opening the screen.

       Lookup      Emulates the 3.0 Lookup Template, performing data
                   entry validation before opening the screen.

       Select      Emulates the 3.0 Select Template, allowing the
                   user to select a record or not.

<    Lookup Field>
Lookup Field

Name the field containing the user's entry to validate
against the first key field component of the Browse
Access Key.

<    Input Field Picture>
Input Field Picture

Enter the display picture token to use to DEFORMAT
the user's entry for the GET statement that validates
the data.

<    Display Key>
Display Key

Enter the KEY to use for data display, if it is different
from the Access Key defined in the procedure's File
Schematic.

<    Lookup Hot Key>
Lookup Hot Key

Enter the KEYCODE to use call the Browse
procedure to allow the user to select an entry.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Using Range Limits>
Using Range Limits

The Range Limit Field allows a subset of the data file to display in
the List box.  The subset of records is based on the value contained
in the Range Limit Field.  The Range Limit Field must be a component
of the Access Key. The Range Limit may be a single value in the
Range Limit Field at the beginning of the procedure, a single value
in any other valriabel named as the Range Value Field, or a range of
values defined by the Low Limit Value and High Limit Value fields.
For example, to use the Current Value type of Range Limit, if you
have two files; Invoice and Items, and you want to Browse all Items
for a selected Invoice, you can limit the records displayed in the
Browse of the Items file. If the Browse Access Key for the Items
file looks like this:

         ITM:InvoiceKey         !Key for ITEMS file
         +- ITM:InvoiceNo       !Invoice Number
         +- ITM:Line            !Line number on Invoice

To limit the displayable records to Items for a single Invoice,
select ITM:InvoiceNo as the Range Limit Field.  Now place
ITM:InvoiceNo as an ENTRY field on the Browse screen before the LIST
field.  When the Browse is executed the user can enter an Invoice
number, and after hitting the TAB key, the List box is filled with
Items for the specified Invoice number. If the Browse Access Key is
a multi-component KEY, and you want to use the entire KEY to limit
the Browse, select the last component of the KEY as the Range Limit
Field. If you place all the KEY fields on the screen as entry
fields, the Browse can be limited by the user at runtime.
Alternatively, you can use the Setup Screen embedded source code
point to prime the KEY components. For example, if the Invoice file
has the following KEY:

         INV:InvoiceKey                  !Key for INVOICES file
         +- INV:InvoiceNo                !Invoice Number
         +- INV:Date !Date of Invoice

You can use the Setup Screen embedded source code point to assign a
value to the Range Limit Field. Given the above KEY for the Invoice
file, you can Browse the Invoice file, and display only the Invoices
for a specific date. To view all invoices for today, you would
enter: INV:Date = TODAY() in the Setup Screen embedded source
window.

You can also use the Single Value type of Range Limit , using both
Range Limit and Range Value Fields.  The value in the Range Value
Field is assigned to the Range Limit Field when the Browse starts.

The Range Value Field is used in conjunction with the Range Limit
Field. When a Browse is started, the value in the Range Value Field
is assigned to the Range Limit Field. This limits the Browse without
having to place the Range Limit Field on the Browse screen.

The Range Value Field is typically assigned a value by the procedure
which calls the Browse. The Range Value Field cannot be the same
field as the Range Limit Field.

For example, you want to let the user Browse the Invoice file,
select an Invoice, and then Browse the Items for the selected
Invoice. The Browse Access Key for the Items file looks like this:

         ITM:InvoiceKey            !Key for ITEMS file
         +- ITM:InvoiceNo          !Invoice Number
         +- ITM:Line                                                    !Line number on Invoice

The Invoice file has the following KEY:

        INV:InvoiceKey              !Key for INVOICES file
        +- INV:InvoiceNo            !Invoice Number
        +- INV:Date                 !Date of Invoice

Enter the Range Limit Field as ITM:InvoiceNo, and enter the Range
Value Field as INV:InvoiceNo.  The Browse of the Items file is
limited to the value of ITM:InvoiceNo, which receives its value from
the Range Value Field INV:InvoiceNo.

Browsing the Invoice file is executed as a "lookup" by entering the
following code in the Setup Procedure Embedded Source point:

        GlobalRequest = SelectRecord    ! call the Browse with the
                                                                                                                                ! "Select" button active
The Browse of the Invoice file allows the user to highlight an
Invoice record, then hit the Select button.  The Select button is
used to call the Browse of the Items file.

When the Browse for Items is executed, INV:InvoiceNo is assigned to
ITM:InvoiceNo. The List box is filled with Items for the Invoice the
user selected.

<Using Record Filters>
Using Record Filters

You can display a subset of a data file using a Range Limit, a
Record Filter, or both.  If the subset of the file is based on a
field value which is a component of the Access Key for the Browse,
then a Range Limit provides the fastest performance. If the subset
of the file is based on a field which is not a component of the
Access Key then you will need to use a record filter. You can use
both a Record Filter and a Range Limit.  This gives you the
performance of a Range Limited Browse, but allows you to display a
subset of the range limited records.

There are 2 methods to enter a record filter. You can use the
Formula Editor to create a formula, and use the FILTER Formula
Class.  The code generated filters the file based on your formula.
You can also use the Record Filter entry field on the Browse
Procedure Properties dialog to enter a freeform record filter
expression. The expression you enter is not automatically checked_
an invalid expression will generate compiler errors.  If you are not
familiar with the Clarion language statements or expressions, use a
Formula field with the FILTER Formula Class instead.

<Using Normal Locators>
Using Normal Locators

A locator field is a screen entry field that updates a component of
the primary file access key. When a value is entered in a locator
field, the closest matching record is displayed in the list box. The
Locator field is usually placed after the LIST field in the Field
List. You can check field order using CTRL+F in the Screen Formatter
(when the cursor is not on a screen field).

Placing the Locator after the LIST in the Field List allows the List
box to be filled as soon as the Browse is called. If the Locator is
placed before the LIST field, the LIST is not filled until the user
presses TAB (to complete the field). For example, scrolling a vendor
file in vendor name sequence uses a key that contains the vendor
name field (e.g. VND:Name).  To create a vendor name locator field,
place a VND:Name entry field on the screen before or after the list
box, and enter VND:Name for the Locator Field on the Browse
Properties Screen.

At runtime, when the user scrolls the List box, typing any character
on the keyboard selects the locator field, and accepts
entry.Pressing TAB positions the highlight bar to the closest match.

Note:  If your Locator field is a Numeric field, you should add the `B' to
the picture token, to blank if zero.

<Using an Incremental Locator >
Using an Incremental Locator

Check the Incremental Locator box to make the Locator Field function
as an Incremental Locator. You must place the Locator field after
the LIST field in the Field List, for the incremental search to work
correctly.

This template option allows one-half second delay for the user to
type a new letter into the locator field. At each pause longer than
one-half second, the Locator contents are used to locate the closest
match (TAB does not need to be pressed). The BACKSPACE key is active
during this process, and reverses the search.

For example, if the user types "S," the first record with "S" is
displayed on the first line of the List box.  If the user then types
"M," a search is made for "SM" and the List box is scrolled to that
record.  Typing a "Y" starts a search for "SMY", and so on. Pressing
the BACKSPACE key repositions the highlight bar in reverse order.
For numeric data types, you should use a string picture type (for
display purposes).  Date fields are not recommended for incremental
locators.

Note: If your Locator field is a Numeric field, you should add the
`B' to the picture token, to blank if zero.

<Recalculating Totals>
Recalculating Totals

If you are using Embedded Source to calculate totals, you can call
the InitializeTotals ROUTINE, in the After Update Procedure embedded
source code point  to re-calculate your totals.   The
InitializeTotals ROUTINE is generated if you have checked Enable
Total Embeds, or you have a Formula with the SUM, CNT, or AVG Class.

  For example:

  IF UpdateSuccessful = True            !if the file was updated
    DO InitializeTotals                 ! recalculate totals
  END

<Browsing Fields from Related Files>
Browsing Fields from Related Files

The Browse procedure looks up fields in a file on the One side of a
Many-to- One relationship from the file being viewed in the List
box.

For example, if you have two files, Customers and Orders. The
relationship from Customers to Orders is One-to-Many_one Customer
may have many Orders. If you create a Browse to view the Orders
file, you can place a field from the Customer file in the List box,
and the Browse procedure automatically looks ups the the related
record in the Customer file.

<Using the Default Buttons >
Using the Default Buttons

The Insert, Change, and Delete buttons call an Update Procedure to
process the highlighted record (Update Procedures are normally
created with a Form or MultiPage template). Enter the name of the
procedure as the Update Procedure on the Procedure Properties
screen.

If you do not name an Update Procedure, these buttons have no
default action. If you delete all three buttons and name an Update
Procedure, the INSERT, ENTER and DELETE keys still call the Update
Procedure. However, if you only remove one or two of these buttons
(Insert, Change, or Delete) the Update Procedure is not called for
the removed button(s).

The Exit button's procedure call is defined as RETURN, so when the
user presses the Exit button they return to the calling procedure.
You may remove the Exit button, but some other provision must be
made to return from the procedure.

<Calling a Browse to Lookup a Value>
Calling a Browse to Lookup a Value

The Select button is used when a Browse procedure is called as a
lookup. The Select button is dimmed unless the Browse is called with
GlobalRequest variable set to SelectRecord (an EQUATE).  If you
won't be using the Browse procedure for lookups, you can delete this
button. When the user presses the Select button, the highlighted
record in the List box is loaded into memory, and the program
returns to the calling procedure.

<Navigating a Browse Procedure at Runtime >
Navigating a Browse Procedure at Runtime

At runtime, when the List box is selected, a highlight bar is always
positioned over a single record in the List box. The UP ARROW and
DOWN ARROW keys move the highlight bar. Moving the highlight bar up
off the top row, or down off the bottom row, scrolls a new record
into the list box. The PGUP and PGDN keys scroll the prior and next
page of records into the list box. CTRL+PGUP displays the first page
of records and CTRL+PGDN displays the last page of records.
Pressing the right mouse button in the top half of the List box
scrolls up and in the bottom half scrolls down.

<Formatter Support>
Formatter Support

The Browse procedure in CD31.APP is pre-loaded with a screen layout
containing a LIST field and buttons named Insert, Change, Delete,
Select, and Exit. The field equate label of the list box MUST be
?List and the Immediate attribute (IMM) must be on turned on.  The
horizontal scroll bar can be turned off if the required information
fits in the list box. The vertical scroll bar is ignored by the
template.  The list box may not have a procedure to call when the
field is completed. All other properties of the list box can be
changed. The Report Formatter is not supported. For more information
on formatting a list box, see Using the List Box Formatter in the
Using Screen Formatter chapter.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section>
Data Section

In the data section of the procedure after local data,
the SCREEN and PULLDOWN structures. This may
be used to declare any data which you may want to
use only in your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  Before Opening Screen>
Before Opening Screen

Immediately before the OPEN(Screen) statement.

<  After Opening Screen>
After Opening Screen

Immediately after the OPEN(Screen) statement.

<  Setup Screen>
Setup Screen

Immediately after the OPEN(Screen) statement.

NOTE: This embed point immediately follows the 'After
Opening Screen' embed point and is provided for pre-3.1
compatibility.

<  Before Entering Loop>
Before Entering Loop

Immediately before the main screen processing LOOP
structure.

<  Top of ACCEPT Loop>
Top of ACCEPT Loop

At the beginning of the main screen processing LOOP
structure.

<  End of General Formulas>
End of General Formulas

When processing a screen field, the formulas which do
not have a FILTER or LIST class are generated.  This
source window allows the entry of computations for
screen display fields without the use of the Formula
Editor.

<  Before ACCEPT Statement>
Before ACCEPT Statement

In the main screen processing LOOP structure
immediately before ACCEPT.

<  Custom OF - CASE KEYCODE()>
Custom OF - CASE KEYCODE()

In the general CASE KEYCODE() structure that is
generated only if a Hot Key is defined for the
procedure. Your custom code in this embed point
must begin with OF or ELSE.

<  Case Of No Records Found>
Case Of No Records Found

Upon initialization and during processing a browse, this embed
point is executed if the condition exists where the browse list
is empty.

<  Case Of Records Found>
Case Of Records Found

Upon initialization and during processing a browse, this embed
point is executed if the condition exists where the browse list
contains one or more records.

<  LIST Class Formula>
LIST Class Formula

After generation of LIST class formulas (may be used
instead of LIST class formulas). This allows setting up
any fields which are displayed within the scrolling list
box.

<  End of Procedure>
End of Procedure

Code placed in this point executes after all other code
in the procedure has executed.

<  Custom Routines>
Custom Routines

This embed point begins in column one and is
designed for any ROUTINEs which are called from
any other embedded source code window.

<  Prior to Update Procedure>
Prior to Update Procedure

Immediately before the Update Procedure is called.

<  After Update Procedure>
After Update Procedure

Immediately after return from the Update Procedure.

<  Set to First Record Before Total Loop>
Set to First Record Before Total Loop

After the SET(key,key) for Range Limits, before
beginning the total calculation LOOP.

<  Inside Total Loop, Immediately after NEXT>
Inside Total Loop, Immediately after NEXT

Immediately after each record is read in the total
calculation LOOP.

<  Inside Total Loop after Filter>
Inside Total Loop after Filter

After each record is read and filter conditions are
evaluated in the total calculation LOOP.

<  After Total Field Loop>
After Total Field Loop

After all totals have been calculated.

<  When Screen Field is Selected>
When Screen Field is Selected

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

<  FILTER>
FILTER

A Conditional Field with FILTER in the Formula
Class field is used to display a subset of the datafile. If
the IF Condition expression evaluates to false for a
given record, it is not displayed. Enter the expression
for the IF Condition field and leave the True Formula
and False Formula fields blank. Only the IF Condition
Expression is used for the filter.
A filter expression can alternatively be entered in the
Browse Procedure Properties Record
Filter field, instead of using the Formula Editor.

<  LIST>
LIST

A Conditional or Computed Field with LIST in the
Formula Class field is used for those values which
will be displayed in the list box and are only evaluated
when the list box item is created.

<  SUM>
SUM

A Computed Field with SUM in the Formula Class
field calculates the Formula Field using the Formula
Expression.

The code is generated as:
FormulaFieldName += FormulaExpression.

A Conditional Field with SUM in the Formula Class
field conditionally calculates the Formula Field using
the Formula Expression contained in the fields named
in the True and False Expressions. The code is
generated as:

IF Condition
   FormulaFieldName += TrueExpression
ELSE
    FormulaFieldName += FalseExpression
END

<  AVG>
AVG

A Computed Field with AVG in the Formula Class
field calculates an Average of the field named in the
Expression. The total value is calculated, then divided
by the number of displayable records to achieve the
arithmetic mean. Displayable records are those
records that are within the Range Limit and meet the
Record Filter criteria.

<  CNT>
CNT

A Computed Field with CNT in the Formula Class
field counts the number of displayable records in the
Browse. Displayable records are those records that are
within the Range Limit and meet the Record Filter
criteria.

<  GENERAL or No class (blank)>
GENERAL or No class (blank)

Calculates the formula every time any field on the
screen is completed.  The calculation code is
generated before the field edit routines at the top of
the field processing code.

<<THE CHILD TEMPLATE>>
THE CHILD TEMPLATE

The Child template creates a procedure which has a screen with
features from both the Browse and Form templates. This template
screen has both a scrolling area and a record update area.

This template is designed to process a batch of child records as a
single transaction. This batch of records must be in a file which is
the child file in a parent-child relationship (the Many side of a
One-to-Many relationship). When a Child Procedure is called, all of
the related children records for the valid parent record in memory
are loaded into a memory QUEUE (the parent record must reside on
disk as well as in memory).  The QUEUE may be modified by adding,
changing, or deleting records.  When the user presses the Ok button,
the QUEUE records are written back to disk as a single transaction.
Changes to the QUEUE are discarded if the Exit button is pressed.

Note:  Autonumbering keys are NOT supported in the CHILD Template.
To use autonumbering keys, use a set of Browse-Form procedures
for updates.

In order to maintain the highest level of data integrity, the child
file update is framed within a Transaction process (see the essay on
Transaction Processing in the Language Reference for details).

The TopSpeed, Btrieve, and Clarion file drivers support Transaction
Processing. Therefore, the Child file must utilize one of these file
drivers in order to work properly.  For drivers which do not support
transaction processing, use a set of Browse-Form procedures.

The correct File Schematic is essential to the proper operation of a
Child template procedure.  Press the Files button from the Procedure
Properties window to see the existing File Schematic, or create a
new File Schematic if one has not already been defined.

The child file must be the first (Primary) file in the File
Schematic. The parent file must be listed below the child file, and
must have a relationship defined with the child file as in the
example below:

This File Schematic is supported:
        Primary (Child file)
                +-> Secondary (Parent file for Child)

This File Schematic is NOT supported:
        Primary (Parent file)
                +->> Secondary (Child file of Parent)

The following is a check-list to help in creating a Child template
procedure for the first time:

*  Create the File Schematic as shown above (Child file first, then
   Parent file). Select an Access key from the Child file to use for
   the list box order.

*  In the Screen Formatter, place fields from the Child file in the
   list box, and Child file ENTRY fields in the area above the Save
   and Exit buttons.

*  Re-order the fields on the screen so that the entry area fields
   are consecutive. Remember which field is your first update field.
   Save the screen structure.

*  Supply the First Update Field and Parent File in the Procedure
   Properties. These fields are required.

<Formatter Support>
Formatter Support

The Child template's default screen is pre-defined with two
logically separate areas: a scrolling area, and a field entry area.
The scrolling area lists all Child records for the selected Parent.
The standard list box keys are available to scroll through the child
records (see the Browse template section for details). Buttons below
the list box allow the user to Insert, Change or Delete records.
Also, an Ok and Cancel button are active while in the scrolling
portion of the screen. The field entry area is similar to a Form in
operation. ENTRY fields are placed in this area to allow data entry
for a child record.  The fields in this area must be consecutive in
the SCREEN structure and must immediately precede the Save and Exit
buttons. A block of fields is selectively ENABLEd and DISABLEd when
moving back and forth between the scrolling area and the update
area. The record may be saved to the list box using the Save button,
or it may be erased by using the Exit button.  The Ok and Cancel
buttons are only available while in the scrolling area. When the Ok
button is pressed, the entries in the QUEUE are written to disk
within a Transaction. If any error occurs, the entire set of records
are rolled back to the status of the file before the Ok button was
pressed and the user is given an opportunity to change any problem
records and attempt a save again. If a Pulldown structure is created
by the Pulldown Menu Formatter, it is generated after the screen
structure. The Pulldown is OPENed after the screen structure, and is
closed upon exit from the procedure. The Report Formatter is not
supported.

<Procedure Properties>
Procedure Properties

The Child template has 2 separate modes of operation. The template
selectively disables fields which are not appropriate to the current mode. In the
Scrolling Area, only scrolling area fields are available. In the
Field Entry Area, only entry specific fields are available.

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  First Update Field>
First Update Field

You must enter the First Update Field here. This
should be the first entry field for the Child file. This is
necessary to properly ENABLE() the range of fields
in the screen structure from this field to the Exit
button.  If the fields are not consecutive in the Field
List, the proper fields may not be ENABLEd or
DISABLEd.  The easiest way to ensure consecutive
entry fields is to Auto Re-order the screen fields just
prior to saving the screen.

<  Parent File>
Parent File

The Parent File must be supplied to identify which
Parent file to use for the relationship.  The Child
template is designed to handle the relationship
between one Parent and one Child file. In order to
ensure that only one user in a multi-user environment
may modify a batch of child records at a time, a
HOLD is placed on the parent record. This signals
other Child procedures that the children for this parent
are currently being modified. Other procedures will be
able to read the parent record, but will not be able to
modify it.

Therefore, it is important that when using a Child
template procedure to modify a file's records, that
there are no other procedures which may modify these
child records. For example, there must not be any
Form template procedures which may modify a child
file's record while it is being updated via a Child
template.

<  Exit on Null Parent>
Exit on Null Parent

Since the parent record information is critical to
finding the correct children for a parent, you may
select to RETURN from the child procedure when no
parent record has been selected. You may also enter
embedded source code to select a parent record and
leave this checkbox blank.

<  Update Parent on OK>
Update Parent on OK

With this box checked, the parent record is PUT back
to its file when the user presses the Ok button. This
allows updating of any parent information which may
have been changed while in the Child procedure.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section>
Data Section

In the data section of the procedure after local data,
the screen and pulldown structures. This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  Setup Screen>
Setup Screen

After OPEN(Screen).

<  Top of ACCEPT Loop>
Top of ACCEPT Loop

After the LOOP statement and prior to generating
formula fields.

<  Prior to Return>
Prior to Return

After exiting the main loop, but prior to FREEing the
QUEUE. This would be a good place to add code
which needs to loop through the RecordQueue for
information before exiting.

<  End of Procedure>
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  This code begins
in column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code window.

<  Enter Scroll Mode Routine>
Enter Scroll Mode Routine

After the DISABLE and ENABLE of the fields to
switch to the scrolling area from the entry field area.
This is a good place to override the automatic
enabling and disabling of fields.

<  Enter Update Mode Routine>
Enter Update Mode Routine

Also a good place to override the automatic enabling
and disabling of fields, but when going to update
mode.

<  When Screen Field is Selected>
When Screen Field is Selected

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

No formula classes are supported by this procedure template. Formula fields
are not supported.

<<THE EXTERNAL TEMPLATE>>
THE EXTERNAL TEMPLATE

The External template notifies the Application Generator that the
procedure is contained in an external source (.CLA), object (.OBJ),
or Library (.LIB) file. No source code is generated for an External
procedure.  The procedure's prototype is placed in the program's MAP
from the MODULE Structure Include File named on the Module
Properties window.

The Module Name field must contain the filename of an external
source, object, or library file.

<<THE FILE TEMPLATE>>
THE FILE TEMPLATE

The File template produces a procedure which will allow the user to
Pick a DOS filename from a listing of files on the currently logged
disk. The user may use the keyboard or the mouse to change
directories or select the file.  Since the file mask is an Entry
field, the file mask may be changed by the user. A DOUBLE-CLICK in
the directory list box changes the directory.  A DOUBLE- CLICK in
the files list box selects the highlighted file.

<Formatter Support>
Formatter Support

The File procedure in CD31.APP is pre-loaded with a screen layout
containing 2 LIST fields, 1 file mask ENTRY field, 1 directory name
display field, and Ok and Cancel  buttons.

The files list box shows filenames in the selected directory which
match the file mask. The directories list box displays any
subdirectories in the current directory and the parent directory
denoted by `..' when available.  The file mask entry field is large
enough to contain a simple file mask of *.??? and causes the files
list box to be rebuilt when changed. The directory display field
displays the current directory (up to 35 characters).

The Ok button writes the selected filename to the specified Filename
Variable and the Cancel button returns to the calling procedure
leaving the Filename Variable with its original value.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  Filename Variable>
Filename Variable

The filename may be saved in any string variable
(STRING(64) is suggested, since the path is added
and DOS allows a 64 character filename). However, a
default variable is in the global data of the default
application file (GLO:Filespec in CD31.APP) to hold
the filename if the Filename Variable is blank.

<  Initial Directory>
Initial Directory

Optionally, an initial directory may be specified for
the opening directory listing (like REPORTS).  The
File template calls SETPATH() just prior to filling the
list box. Another SETPATH() returns to the original
path before returning from this procedure.

<  Beginning file mask>
Beginning file mask

A beginning file mask may be specified to use for the
opening file list. The files will be sorted within the
mask. If no match for the file mask is found, the text
NO MATCH appears in the file list box.  If no
Beginning File Mask is supplied, the default file mask
(*.*) is used.

<  Next Procedure>
Next Procedure

Enter the name of a procedure to be called once a
filename has been successfully selected. The Filename
Variable is assigned the selected filename and the
Next Procedure is called.

The View template was designed in conjunction with
the File template and may be used to view the selected
file.  Enter the name of a procedure created with the
View template as the Next Procedure for this
combination.

<  Reselect Upon Return>
Reselect Upon Return

If a Next Procedure is defined, you may:

1) Return to the calling procedure after returning from the Next
   Procedure (the default).

2) Allow the user to reselect another filename after returning from
   the Next Procedure (when the box is checked).

<  Blank Name On Cancel>
Blank Name On Cancel

If checked, the variable you named as the Filename
Variable (above) is blanked when the user presses the
Cancel button.  When no Filename Variable is
specified, GLO:FileSpec (the default filename
variable) is cleared.

This option is useful when using a File template
without a Next Procedure.  In this case, it is possible to
detect if the user has not selected a file by checking
the value contained in the specified Filename Variable
(or GLO:FileSpec).

<  Allow Drive Searches>
Allow Drive Searches

If checked, the list of directories also displays all the
current DOS drive letters.  This allows the user to
search for the file on any valid drive.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section >
Data Section

In the data section of the procedure before local data,
the screen and pulldown structures.  This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  Setup Screen>
Setup Screen

After the OPEN(Screen) statement.

<  Top of Accept Loop>
Top of Accept Loop

At the top of the screen field processing LOOP.

<  End of Procedure>
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  This code begins
in column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code window.

<  When Screen Field is Selected>
When Screen Field is Selected

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

No formula classes are supported by this procedure template. Formula
fields are not supported.

<<THE FORM TEMPLATE>>
THE FORM TEMPLATE

The Form template generates a procedure that will Add, Change, or
Delete a record from the procedure's Primary file (defined in the
File Schematic). If the Enable Shared Files Global Application
prompt is checked, the code is generated with complete Record-level
locking for a multi-user application. Referential Integrity
constraints, as defined in the Data Dictionary, are enforced during
any update to the Primary file, for all One-to-Many relationships to
the Primary file.

The template allows for multiple auto-increment key fields and
concurrency checks of multiple memo fields.

<Data Dictionary Validity Checks>
Data Dictionary Validity Checks

Initial field values defined in the Data Dictionary are pre-loaded
during an Add. Range checks (the Must Be In Range Validity Check)
are generated from the Data Dictionary definitions and are enforced
during an Add or Change. If an out of range condition exists, the
user is notified of the valid range for the field (using the
ShowWarning procedure), and the cursor is placed on that field for
editing.

The template automatically generates GET statements to access any
secondary files where the relationship from the procedures Primary
file is defined as Many-to-One.  Fields from the One side of the
relationship should be placed on the screen as display-only.  No
code is generated to update files on the One side of the
relationship.

For example, suppose in the Data Dictionary you have defined
Customers and Invoices as a One-to-Many relationship_One customer
may have Many invoices. That means the Invoices file is  related
Many-to-One to the Customers file. On the Form procedure used to
update the Invoices file you can place the Custyomer's  name and
address fields on the screen, and the correct Customers file record
is retrieved from the   file. But even if you allowed changes to the
Customers file  name and address fields, there is no code generated
to update the Customers record.

A Must Be In File validity check defined in the Data Dictionary is
enforced when the field is completed, or when the user presses the
Ok button.

<Entry Fields with a Lookup Procedure>
Entry Fields with a Lookup Procedure

Lookups are enabled through the Entry Field Properties window in the
Screen Formatter. Enter the name of a Browse procedure in the When
Field is Selected Procedure field, if you want a Browse lookup to
appear as soon as the field is selected by the user.  Use the When
Field is Completed Procedure if you want to  validate an entry after
the user completes the field. This calls the lookup procedure only
if the entry is not valid.

<Multiuser File Updates>
Multiuser File Updates

If the application is set to SHARE files, the procedure enforces
multi-user concurrency checking at the record level.  If a conflict
arises from two or more workstations attempting to update the same
record, the Record is re-read from disk and the FORM screen is
refreshed.  The user is notified of the change, and placed back in
edit mode.

<Maintaining Referential Integrity>
Maintaining Referential Integrity

If Relational Constraints have been defined in the Data Dictionary,
code is generated to enforce the Constraint on One-to-Many
relationships.  All Referential Integrity Constraints are enforced
from the Primary file for the procedure, down its Relational File
Tree for as many levels as exist.

<Transaction Framing>
Transaction Framing

During a relational Change or Delete, a HOLD is placed on the
Primary file record.  All Child files of the Primary file are
updated within a transaction frame to ensure an `all or nothing'
update or delete.  If the is an error on the LOGOUT statement, the
user is given a chance to retry the update or delete. Not all file
drivers support Transaction Processing.  If you are using a File
driver that does not support transaction processing, or are using
multiple file drivers within a relationship, you will receive a
Warning during code generation:   "PRIMARY file driver does not
support LOGOUT()". If the file driver does not support the LOGOUT
statement, code is generated to update the files without the benefit
of a transaction frame. Also, if the files in the Relationship use
multiple file drivers, the referential update/delete cannot use the
LOGOUT statement.

For example, if a file relationship is defined with one file using
the Btrieve driver and the related file using the Clarion driver,
code is generated without a LOGOUT transaction frame.  Either
situation has the potential to compromise the Referential Integrity
of your database.  If the update/delete fails for any reason, your
files cannot be restored to their original state. Finally, if you
have set up multiple relations between the same two files,
transaction framing cannot process these relations.  This will be
evident at run- time as a Clarion Run-Time error, Cannot Logout
Files.  In this case, check the Disable RI Logout box on the
Procedures Properties screen.

<Formatter Support>
Formatter Support

The default screen contained in CD31.APP has a local variable named
LOC:Message placed at the top of the entry screen. This variable is
used to inform the user of the current action: Add, Change, or
Delete of the record on the screen.  The message displayed is stored
in CD31.APP in the global variables as GLO:InsertMsg, GLO:ChangeMsg,
and GLO:DeleteMsg.

You can specify your own messages on the Procedure Properties
window. If any Prompt for a message is filled in, it is used instead
of the global values stored in the default .APP file.

The default screen has two buttons: Ok and Cancel. Both of these
fields are required by the template.

If a Pulldown structure has been created by the Pulldown Menu
Formatter, it is generated after the screen structure. The Pulldown
is OPENed after the screen structure, and is closed upon exit from
the procedure.

The Report Formatter is not supported.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  Insert Message>
Insert Message

Enter a message to use instead of the default stored in
CD31.APP for Inserting a record.

<  Change Message>
Change Message

Enter a message to use instead of the default stored in
CD31.APP for Changing a record.

<  Delete Message>
Delete Message

Enter a message to use instead of the default stored in
CD31.APP for Deleting a record.

<  Action after ADD>
Action after ADD

The template supports multiple adds without leaving
the FORM screen.  There are four possible actions
after an ADD:

Return to caller generates code to return to the
calling procedure after the record is added.

Retain Record generates code to allow continuous
ADDs without clearing the record buffer or the screen.
When the user selects the Ok button, the record
buffer's contents are ADDed to the file and the user is
placed back on the first entry field on the screen. If
there are Auto-increment keys defined for the file, the
record is saved, the next Autonumber is retrieved, then
the record is restored.

Clear Record generates code to allow continuous
ADDs but clears the record buffer and screen between
each ADD.  When the user selects the Ok button the
screen and record buffer are cleared and the user is
placed back on the first entry field on the screen. If
there are Auto-increment keys defined for the file, the
next Autonumber is retrieved and the screen updated.

<  Copy field hotkey>
Copy field hotkey

This prompt is dependent on the Retain Record radio
button. If Retain Record is enabled, and the Copy
field hotkey contains a hotkey value, the template
generates code for repeated ADDs that allows the user
to duplicate individual fields from the prior record
when the hotkey is pressed. When the user presses the
Ok button, the screen fields are erased and the cursor
is placed back on the first field. If the user presses the
defined hotkey the contents of the currently
highlighted field are copied from the last record the
user added.

<  Next Procedure>
Next Procedure

Enter the Procedure to call when the Ok button is
pressed, after the file's update has completed without
any errors. The Next Procedure call is generated
before the code for any Repeated ADDs.

<  Disable RI Logout>
Disable RI Logout

Check this box to stop Referential Integrity code from
generating. If multiple constrained relations exist
between any two files processed by the Referential
Integrity code, when this code is processed your
program will get a Clarion Runtime halt "Cannot
Logout Files."  Note:  If you check this box, RI
Transactions will not be recoverable if an error occurs.

It is also appropriate  to check this box if you are using
a File driver that handles RI in the database engine
(such as the AS/400).

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section >
Data Section

In the data section of the procedure after local data,
the screen and pulldown structures. This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  On Add After Record Buffer Is Cleared >
On Add After Record Buffer Is Cleared

Immediately after the record buffer is cleared for an
AddRecord and just before auto-incrementing fields
are incremented or fields with initial values are
initialized.

<  Setup Screen >
Setup Screen

After OPEN(Screen).

<  Before File I/O >
Before File I/O

Immediately before the record is written to disk
(ADD, PUT, or DELETE).

<  Setup Next Procedure >
Setup Next Procedure

If a Next Procedure was specified, code is inserted
before the procedure is called.

<  Return from Next Procedure >
Return from Next Procedure

If a Next Procedure was specified, code is inserted
after the procedure is executed.

<  After ADD on Retain or ClearRecord >
After ADD on Retain or ClearRecord

After a record has been added and just before going on
to add another record in "recursive add mode."

<  End of Procedure >
End of Procedure

Code placed in this window executes after all other
code in the procedure executs. This code begins in
column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code point.

<  When Screen Field is Selected>
When Screen Field is Selected

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

<  SETUP >
SETUP

A Conditional or Computed Field with SETUP in the
Formula Class field is calculated once at the
beginning of the procedure before the screen field
processing LOOP.

<  RETURN >
RETURN

A Conditional or Computed Field with RETURN in
the Formula Class field is calculated once just before
the return from the procedure when the user selects
the Ok button.

<  PRIMEKEY >
PRIMEKEY

A Conditional or Computed Field with PRIMEKEY
in the Formula Class field is calculated just before the
SET(Key,Key) during an Autoincrement ADD. It is
inserted again right before the ADD(File) to preserve
any components you have primed.

This can be used to prime key components to enable
subset numbering. For example, it can be used to
cause autonumbering of line item numbers on an
invoice.  If you have defined a key with the fields
InvoiceNumber and LineItemNo, supply the current
InvoiceNumber as a PRIMEKEY Formula.  The
AutoNumber Routine determines the next available
LineItemNo for that invoice.  The record ADDed to
the file will already have InvoiceNumber and
LineItemNo in the record buffer and on disk.

<  GENERAL or No class (blank) >
GENERAL or No class (blank)

Calculates the formula every time any field on the
screen is completed.  The calculation code is
generated before the field setup routines at the top of
the processing LOOP.

<<THE FORM21 TEMPLATE>>
THE FORM21 TEMPLATE

The Form21 template generates a procedure that will Add, Change or
Delete a record from the procedure's Primary file (as defined in the
File Schematic). This form is similar to the (non-CUA) Clarion
Prfessional Developer, version 2.1 Form procedure (the same
keystrokes are available to navigate and complete the form, as well
as version 3.0 button support).

Keystrokes supported:

         CTRL+ESC   = Cancel
         CTRL+ENTER = Done
         ENTER      = Field complete or Done (on last field)
         ESC        = Field return or Cancel (on first field)

This procedure automatically enforces multi-user concurrency
checking at the record level, just as the version 2.1 NETWORK.MDL
did. If a conflict arises from two or more workstations attempting
to update the same record, the user's Screen is refreshed with the
record as changed by the other workstation, the user is notified of
the change, and placed back in edit mode.

<Formatter Support>
Formatter Support

The default screen contained in CD31.APP is an empty screen.
The Pulldown Menu Formatter is not supported.
The Report Formatter is not supported.

<Procedure Properties>
Procedure Properties

<  Procedure Title>
Procedure Title

Enter the procedure's Title.

<  Setup Procedure>
Setup Procedure

Enter the Procedure to call at the beginning of the
procedure.

<  Next Procedure>
Next Procedure

Enter the Procedure to call when the Ok button is
pressed (or the form has been "completed"), AFTER
the file's update has completed without any errors.
The Next Procedure call is generated before the code
for any Repeated ADDs.

<  Secondary File 1>
Secondary File 1

Enter the name of a Secondary file whose record is
PUT when the procedure writes to disk.

<  Secondary File 2>
Secondary File 2

Enter the name of a Secondary file whose record is
PUT when the procedure writes to disk.

<  Secondary File 3>
Secondary File 3

Enter the name of a Secondary file whose record is
PUT when the procedure writes to disk.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section>
Data Section

In the data section of the procedure after local data,
the screen and pulldown structures.  This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the 'Setup Procedure' prompt code. The Conversion
places the original 2.1 'Setup Procedure' code into the 'Setup
Procedure' prompt.  This embed point enables additional code to be
generated following the 'Setup Procedure' prompt code.

<  Setup Screen >
Setup Screen

At the beginning of the procedure, after the
OPEN(Screen) statement.

<  Before the ACCEPT Statement>
Before the ACCEPT Statement

Immediately before the ACCEPT statement.

<  After the ACCEPT Statement>
After the ACCEPT Statement

Immediately after the ACCEPT statement.

<  When Screen Field is Selected>
When Screen Field is Selected

In the CASE SELECTED() structure, executed when
the field has been selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<  Custom Routines>
Custom Routines

Use this window to write any ROUTINEs which are
called from any other embedded source code window.

<Formula Classes>
Formula Classes

<  Display Computed>
Display Computed

Calculates the formula every time any field on the
screen is completed.

<  Display Conditional>
Display Conditional

Calculates the formula every time any field on the
screen is completed.

<  GENERAL or No class (blank) >
GENERAL or No class (blank)

Calculates the formula every time any field on the
screen is completed.

<<THE LIST TEMPLATE>>
THE LIST TEMPLATE

The List template generates a procedure that scrolls data files on
the screen like a spreadsheet.  Unlike the Browse, Lookup, or
Validate templates the List template loads every selected record
from the file into memory before displaying the list box.

The Queue for the list box must keep track of key values and pointer
fields as well as the information displayed in the list box.
Therefore, Using the list template for a very large file would fill
virtual memory and overflow onto disk. In effect the file is being
copied before it is displayed.  For this reason, the List template
should only be used to display relatively small files or relatively
small sections of large files. Selected fields from the data file
are displayed as columns in a list box.  Columns that do not fit in
the list box are displayed using a mouse with the horizontal scroll
bar or the left and right arrow keys. A selector bar is always
positioned over a single row.  The up and down arrow keys move the
selector bar.  Moving the selector bar up off the top row or down
off the bottom row scrolls a new record into the list box.

The PGUP and PGDN keys scroll the prior and next pages of records
into the list box.  CTRL+PGUP displays the first page of records and
CTRL+PGDN displays the last page of records. Pressing the right
mouse button in the top half of the list box scrolls up and in the
bottom half scrolls down.  The LIST field must be the first field in
the SCREEN structure when not using a Record Filter or Range Limits.

Fields may be placed before or after the LIST field in the Field
List. Selecting the LIST field from a prior field displays the first
page of records.  The Insert, Change, and Delete buttons, or any
other field that processes the record under the selector bar must be
placed after the LIST field in the Field List. You can view a file
in Record order. This is primarily useful in viewing ASCII files.
Since ASCII, BASIC, and DOS files have certain limitations, you
should know the file system's capabilities before attempting to use
the List template with an Update Procedure (the View template may be
used to just View an ASCII file). If the Checkbox is checked on, any
reference to a primary key is ignored by this procedure.

You can also display the queue in reverse order. When the Record
Order box is not checked, the Reverse Order box displays the file in
reverse key order. If Both the Record Order and Reverse Order boxes
are checked, the file displays in reverse record order.

A set of display-only fields can be designated as "hot fields" on
screen. Hot fields display values from the record currently
highlighted by the selector bar and change whenever the selector bar
moves.  This allows display of more information from the highlighted
record than just the one line in the List box. These hot fields MUST
appear consecutively in the Field List but may be placed anywhere on
screen.

<Formatter Support>
Formatter Support

The List procedure in CD31.APP is pre-loaded with a screen layout
containing a LIST box and Insert, Change, Delete, and Exit buttons.
The field equate label of the LIST field must be ?List.

The horizontal scroll bar can be turned off if the required
information fits in the list box.  The vertical scroll bar is also
optional.  All other properties of the list box can be changed.
Fields from related files may be scrolled in the list box since
"lookups" are done automatically from the Primary file to Secondary
files in the File Schematic with a "Many to 1" relationship.

The Insert, Change, and Delete buttons call an Update Procedure to
process the selected record (the Update Procedure is normally
created with a Form template). The name of the procedure must be
entered as the Update Procedure. If there is no Update Procedure,
these buttons can be deleted. If all three buttons are deleted, and
an Update Procedure exists, the Insert, Enter and Delete keys will
Insert, Change and Delete while the list box is selected. However,
If only one or two of these buttons have been removed the function
of that button (Insert, Change, or Delete) is removed from the list
box as well and no Update Procedure is called.

The Exit button should not be deleted.

Local data is generated before the screen structure.

If a pulldown structure has been created by the Pulldown Menu
Formatter, it is generated after the screen structure.  The template
makes no provision for opening or closing a pulldown menu.  Such
statements must be entered as embedded source.

The Report Formatter is not supported.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  Range Limit Field>
Range Limit Field

The range of records to be displayed can be limited by
fixing the value of a component of the primary file
access key.  For example, line items on an invoice can
be limited to a single invoice.  The key for the item
file might contain ITM:Invoice and ITM:Line
containing the invoice number and line number of the
item. ITM:Invoice would be the Range Limit Field,
displaying only those records for a fixed invoice
number.

<  Range Value Field:>
Range Value Field:

The Range Value Field is the field which holds the
value to be used as the limiting key component value.
The key component will be assigned this value. In this
example, the current Invoice record might contain the
number of the invoice that is being displayed.
INV:Number would be the Range Value Field,
supplying the value for the Range Limit Field.  The
Range Value Field must not be the same field as the
Range Limit Field.

<  Record Filter>
Record Filter

Enter a free-form record filter expression in this field.
No validation is done on the code you enter_an
invalid expression will generate compiler errors.  If
you are not familiar with the Clarion language
statements or expressions, you should use a Formula
field with the FILTER Formula Class instead.

<  Update Procedure:>
Update Procedure:

Enter the name of the Update Procedure to use to
insert, change, or delete records.  If no Update
Procedure is entered, the Insert, Change, and Delete
buttons should be removed from the screen layout.

Special considerations may exist when using ASCII,
DOS, and BASIC file drivers.  In some cases a PUT or
DELETE is not allowed.  See the Database Drivers
Appendix for file driver specifics.

<  First Hot Field:>
First Hot Field:

Hot fields are a set of display-only fields that display
the contents of the record under the selector bar.  They
must appear consecutively in the Field List. Enter the
name of the first hot field.

<  Last Hot Field:>
Last Hot Field:

Enter the name of the last hot field.

<  Enable Hot Records >
Enable Hot Records

By enabling hot records the programmer has complete
control at every list box movement from the Browse
manager. With this option enabled, every movement
of the point bar gets the record under the point bar into
memory, looks up any many to one secondary files,
computes any general formulas and executes any
embedded source code which was entered in the
`Process Selected Record' code window.

<  Queue Rebuild>
Queue Rebuild

This checkbox causes the QUEUE to be rebuilt after
each call to the Update Procedure.  This is suggested
when using shared files, or when calling a form with
multiple add capability.

<  Record Order >
Record Order

Checking this box causes the template to ignore any
key file
access information.  Therefore, the Access Key in the
File Schematic is ignored and Range Limits cannot be
used.

This option was created to allow the view of ASCII,
DOS, and BASIC files.

<  Reverse Order>
Reverse Order

This checkbox reverses the order in which the
QUEUE is built.  This allows a reverse key file listing
of records in file systems which do not support
descending keys.

<  Progress Indicator>
Progress Indicator

Checking the Progress Indicator Checkbox will
display a moving bar across the screen as records are
loaded into the QUEUE.  The bar is displayed in the
Local Data variable named StatusLine which has been
pre loaded into the Default Application file.  This line
has also been placed on the default screen for the List
template and must be in the screen list after the list
box.

<  Progress Character>
Progress Character

Allows you to specify the ASCII character to be used
as the `bar.'  You can look up ASCII values in the
ASCII chart from the Tools menu.  The ASCII value
should be surrounded by angle brackets within single
quotes.  The Default Application file is preloaded with
a shaded bar character `<176>'.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section>
Data Section

In the data section of the procedure after local data,
the screen and pulldown structures.  This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  Setup Screen>
Setup Screen

After OPEN(Screen) statement.

<  Setup Pulldown>
Setup Pulldown

After OPEN(PullDown) statement.

<  LIST Class Formula>
LIST Class Formula

After generation of LIST class formulas.  This
embedded code window may be used instead of LIST
class formulas.  This allows setting up any fields
which are displayed within the scrolling list box.

<   End of General Formulas>
End of General Formulas

When processing a screen field, the formulas which do
not have a class of `FILTER' of `LIST' will be
generated.  This embedded source window allows the
entry of computations for screen display fields
without the use of the Formula Editor.

<  Process Selected Record>
Process Selected Record

Code entered in this EMBED will be placed in the
FIELD() processing of ?LIST, directly before the
handling of KEYCODE(). This EMBED point is only
generated if Hot records are enabled.

<  End of Procedure>
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  This code begins
in column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code window.

<  When Screen Field is Selected : >
When Screen Field is Selected :

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

<  FILTER>
FILTER

A conditional formula of class "FILTER" created by
the Formula Formatter is used to select which records
are displayed.  If the conditional formula evaluates to
zero (false) for a given record, it is not displayed.

<  LIST >
LIST

A Conditional or Computed Field with "LIST" in the
Formula Class field is used for those values which
will be displayed in the list box and are only evaluated
when the list box item is created.

<  GENERAL or No class (blank)>
GENERAL or No class (blank)

Calculates the formula every time any field on the
screen is completed.  The calculation code is
generated before the field setup routines at the top of
the processing LOOP.

<<THE MENU TEMPLATE>>
THE MENU TEMPLATE

The Menu template generates a procedure that displays a pop-up menu
used to execute other procedures.  Menu items are placed on screen
as BUTTON in the Screen Formatter.  The procedure associated with
each button must be its When Button is Pressed Procedure.  At least
one button field should have a RETURN procedure call to exit the
Menu procedure.

Other fields can be placed on the screen. However, this template
makes no provision for accessing or updating data files.

<Formatter Support>
Formatter Support

The Menu procedure in CD31.APP is preloaded with a screen layout
containing a button named Exit.  The Exit button calls the RETURN
procedure.  The Exit button can be renamed, but if it is deleted,
some other provision must be made to return from the procedure.
Local data is generated before the screen structure.

If a pulldown menu has been created by the Pulldown Menu Formatter,
it is generated after the screen structure.  However, the "Menu"
template makes no provision for opening or closing a pulldown menu.
Such statements must be entered as embedded source.

The Report Formatter is not supported.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section >
Data Section

In the data section of the procedure after local data,
the screen and pulldown structures.  This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  Setup Screen >
Setup Screen

After OPEN(Screen).

<  Top of Accept Loop>
Top of Accept Loop

Immediately after the LOOP statement which
processes each screen field.

<  End of Procedure>
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  This code begins
in column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code window.

<  When Screen Field is Selected>
When Screen Field is Selected

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

No formula classes are supported by this procedure Template. All
statements from the Formula Formatter are generated at the top of
the keyboard loop before the field setup routines.

<<THE MULTIPAGE TEMPLATE>>
THE MULTIPAGE TEMPLATE

The MultiPage template is designed to work in conjunction with the
PageOf procedure template.  The MultiPage template generates a
procedure that will Add, Change or Delete a record from the
procedures Primary file.  The template allows for multiple
auto-increment key fields and concurrency checks of multiple memo
fields.  Relational integrity constraints are enforced from the
Primary file down its relational tree, for all 1:MANY relationships.
The MultiPage and the PageOf templates are designed to work
together.  All file I/O is done by the MultiPage procedure.

Access to the PageOf procedures is handled thru MultiPage. The
PageOf procedures are expected to use the same data file as the
MultiPage procedure. MultiPage passes each PageOf procedure the
following parameters: the current Page number, the total number of
Pages, and the Message describing the current update.

Any of the first 9 PageOf procedures can be accessed directly from
MultiPage by pressing the ALT key and the corresponding page number.
Pressing the PGDN key from any page access the next available page.
Pressing PGDN on the Last Page wraps around to the main (MultiPage)
page.

    MultiPage ( First page of a multi-page data entry form )
    PageOf  (the page 2 procedure)
    PageOf (the page 3 procedure)
                    ::::::::
    PageOf (the page 50 procedure - the maximum number of pages)

The template supports up to forty-nine (49) additional pages. The
PageOf procedure calls are all entered through the MultiPage
template's Procedure Properties window. Procedures named in the Page
prompts must use the PageOf procedure template. At runtime the
generated procedure tracks which PageOf procedures have been called.
When the user presses the Ok button,any PageOf procedure which has
not yet been accessed by the user, will be called in order to check
for Required fields. The PageOf procedure is called and immediately
placed in nonstop edit mode. If a required field has been left
blank, the user is notified and placed in edit mode. Initial field
values from the data dictionary are pre-loaded during an Add. Range
checking is generated from the data dictionary definitions and is
enforced during Add or Change. If an out of range condition exists
the user is notified of the valid range for the field, and the
cursor is placed on that field for editing. The template generates
lookups for accessing secondary files where the relationship is
defined as MANY:1. The Must Be In File automatic field validation is
enforced when the user selects OK. If the value entered does not
exist in the specified file the user is notified and is placed back
on the field. If the application is set to SHARE files, the
procedure enforces multi-user concurrency checking at the record
level.  If a conflict arises from two or more workstations
attempting to update the same record, the user's Screen is refreshed
with the record as changed by the other workstation, the user is
notified of the change, and placed back in edit mode.

<Referential Integrity>
Referential Integrity

If Relational Constraints have been defined in the Data Dictionary,
code is generated to enforce the Constraint on 1:MANY relationships.
All Referential Integrity Constraints are enforced from the Primary
file for the procedure, down its Relational File Tree for as many
levels as exist.

<Transaction Framing>
Transaction Framing

During a relational Change or Delete a HOLD is placed on the Primary
file record.  All child files of the Primary file are updated within
a transaction frame to ensure an `all or nothing' update or delete.
If LOGOUT cannot be initiated, the user is given a chance to retry
the update or delete.

Not all file drivers support transaction processing. If the file
driver does not support the LOGOUT statement, code is generated to
update the files without the benefit of a transaction frame. Also,
if the files in the Relationship use multiple file drivers, the
referential update/delete cannot use the LOGOUT statement.

For example, if a file relationship is defined with one file using
the Btrieve driver and the related file using the Clarion driver,
code is generated without a LOGOUT transaction frame. Either
situation has the potential to compromise the referential integrity
of your database.  If the update/delete fails for any reason, your
files cannot be restored to their original state.

Finally, if you have set up multiple relations between the same two
files, transaction framing cannot process these relations.  This
will be evident at run- time as a Clarion Run-Time error, Cannot
Logout Files.  In this case, check the Disable RI Logout Check-box
on the Procedures Property screen.

<Formatter Support>
Formatter Support

The default screen contained in CD31.APP has a local variable named
LOC:Message placed at the top of the entry screen. This variable is
used to inform the user of the current action: Add, Change, or
Delete of the record on the screen.  The message displayed is stored
in CD31.APP in the global variables GLO:InsertMsg, GLO:ChangeMsg,
and GLO:DeleteMsg respectively.

The programmer can enter his own messages on the Procedure
Properties window. If any Prompt for a message is filled in, it will
be used instead of the global values stored in the default .APP
file. The default screen also has two local variables for page
number display; LOC:Page and LOC:Pages. These variables are used to
display the current page (LOC:Page), and the total number of pages
(LOC:Pages). The template places an ALRT attribute for the ALT+# key
for each of the first 9 procedures named in the Page prompts.  Each
of the first 9 page procedures can be called by pressing ALT and the
"Page's Procedure number" key.

For example, ALT+2 calls the Page2 procedure, ALT+3 the Page3
procedure, and so on. The default screen has three buttons; Ok,
Cancel and Next_Page. All three fields are required by the template.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  Insert Message>
Insert Message

Enter a message to use instead of the default stored in
CD31.APP for Inserting a record.

<  Change Message>
Change Message

Enter a message to use instead of the default stored in
CD31.APP for Changing a record.

<  Delete Message>
Delete Message

Enter a message to use instead of the default stored in
CD31.APP for Deleting a record.

<  Next Procedure>
Next Procedure

Enter the Procedure to call when the Ok button is
pressed, AFTER the file's update has completed
without any errors. The Next Procedure call is
generated before the code for any Repeated ADDs.

<  Disable RI Logout>
Disable RI Logout

If multiple CONSTRAINED relations exist between
any two files processed by the Referential Integrity
code, when this code is processed your program will
experience a Clarion Run-Time halt, Cannot Logout
Files.  Check the Disable RI Logout Check-Box to
stop the RI code from generating.  Note:  ANY RI
TRANSACTIONS will not be recoverable if an error
occurs.

<  Pages 2 through 10>
Pages 2 through 10

Calls a window containing prompts for 9 additional
pages.

<  Pages 11 through 20>
Pages 11 through 20

Calls a window containing prompts for 10 additional
pages.

<  Pages 21 through 30>
Pages 21 through 30

Calls a window containing prompts for 10 additional
pages.

<  Pages 31 through 40>
Pages 31 through 40

Calls a window containing prompts for 10 additional
pages.

<  Pages 41 through 50>
Pages 41 through 50

Calls a window containing prompts for 10 additional
pages.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source>
Embedded Source

<  Data Section >
Data Section

In the data section of the procedure after local data,
the screen and pulldown structures. This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  Setup Screen >
Setup Screen

After OPEN(Screen).

<  Setup Next Procedure >
Setup Next Procedure

If a Next Procedure was defined, code is inserted
before the procedure is called.

<  Return from Next Procedure >
Return from Next Procedure

If a Next Procedure was defined, code is inserted after
the procedure is executed.

<  Ok Button Press >
Ok Button Press

Code is inserted to execute as soon as the "Ok" button
is pressed, before going into non-stop mode.

<  Next Page Button Press >
Next Page Button Press

Code is inserted to execute as soon as the Next_Page
button is pressed, before accessing the next page.

<  End of Procedure >
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  This code begins
in column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code window.

<  When Screen Field is Selected : >
When Screen Field is Selected :

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

<  SETUP >
SETUP

A Conditional or Computed Field with "SETUP" in
the Formula Class field is calculated once at the
beginning of the procedure before the screen field
processing LOOP.

<  RETURN >
RETURN

A Conditional or Computed Field with "RETURN" in
the Formula Class field is calculated once just before
the return from the procedure when the user selects
the `Ok' button.

<  PRIMEKEY >
PRIMEKEY

A Conditional or Computed Field with "PRIMEKEY"
in the Formula Class field is calculated just before the
SET(Key,Key) during an Autoincrement ADD. It is
inserted again right before the ADD(File) to preserve
any components you have primed.

This can be used to prime key components to enable
subset numbering. For example, it can be used to
cause autonumbering of line item numbers on an
invoice.  If you have defined a key with the fields
InvoiceNumber and LineItemNo, supply the current
InvoiceNumber as a PRIMEKEY Formula.  The
AutoNumber Routine determines the next available
LineItemNo for that invoice.  The record ADDed to
the file will already have InvoiceNumber and
LineItemNo in the record buffer and on disk.

<  GENERAL or No class (blank) >
GENERAL or No class (blank)

Calculates the formula every time any field on the
screen is completed.  The calculation code is
generated before the field setup routines at the top of
the processing LOOP.

<<THE PAGEOF TEMPLATE>>
THE PAGEOF TEMPLATE

The PageOf template is designed to work together with the MultiPage
template. PageOf is subordinate to MultiPage.  The PageOf procedure
has no facility to update a record on disk.  All file updates are
handled by the MultiPage template procedure.

A PageOf procedure's prototype in the MAP looks like:

                 ProcName(*BYTE,BYTE,STRING)

The parameters passed from the MultiPage procedure are:

                (Page,Pages,Message)

The PageOf procedures are expected to use the same data file as the
MultiPage procedure.  MultiPage passes each PageOf procedure the
following parameters: the current Page number, the total number of
Pages, and the Message describing the current update.

At runtime the MultiPage procedure tracks which PageOf procedures
have been called. When the user presses the Ok button, any PageOf
procedure which has not yet been accessed by the user will be called
in order to check for Required fields. The PageOf procedure is
called and immediately placed in nonstop edit mode. If a required
field has been left blank, the user is notified and placed in edit
mode.

Initial field values from the data dictionary are pre-loaded during
an ADD. Range checking is generated from the data dictionary
definitions and is enforced during ADD or CHANGE.  If an out of
range condition exists the user is notified of the valid range for
the field, and the cursor is placed on that field for editing.

The template will generate lookups for accessing secondary files
where the relationship is defined as MANY:1.  The Must Be In File
automatic field validation is enforced when the user presses the Ok
button.  If the value entered does not exist in the specified file,
the user is notified and is placed back on the field.

If the application is set to SHARE files the MultiPage procedure
enforces multi-user concurrency checking at the record level.

If Relational Constraints have been defined in the Data Dictionary,
the code generated from the MultiPage template enforces those
constraints.

<Formatter Support>
Formatter Support

The default screen contained in CD31.APP has a local variable named
LOC:Message placed at the top of the entry screen. This variable is used to
inform the user of the current action: Add, Change, or Delete of the
record on the screen.  The message displayed is stored in CD31.APP
in the global variables GLO:InsertMsg, GLO:ChangeMsg, and
GLO:DeleteMsg respectively.

The programmer can enter his own messages on the Procedure
Properties window. If any Prompt for a message is filled in, it will
be used instead of the global values stored in the default .APP
file.

The default screen also has two local variables for page number
display; LOC:Page and LOC:Pages. These variables are used to display
the current page (LOC:Page), and the total number of pages
(LOC:Pages).

The PGUP and PGDN keys will access the next or prior page
procedures. The CTRL+PGUP and CTRL+PGDN keys will call the first or
last page procedures respectively.

The default screen has four buttons; Base_Page, Previous_Page,
Next_Page, and Last_Page. The Next_Page and Previous_Page button
fields are required by the template, Base_Page and Last_Page are
optional. Pressing the Base_Page button will return the user to the
main page (MultiPage template). The Previous and Next Page buttons
call the next or previous page procedures. The Last_Page button
calls the last page procedure defined on the MultiPage procedure
property screen.

If a Pulldown structure has been created by the Pulldown Menu
Formatter, it is generated after the screen structure. The Pulldown
is OPENed after the screen structure, and is closed upon exit from
the procedure. The Report Formatter is not supported.

<Procedure Properties>
Procedure Properties

The PageOf Procedure Properties window has no specialized prompts.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source>
Embedded Source

<  Data Section >
Data Section

In the data section of the procedure after local data,
the screen and pulldown structures. This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  Setup Screen>
Setup Screen

After OPEN(Screen).

<  Base_Page Button Press >
Base_Page Button Press

Code is inserted to execute as soon as the "Base Page"
button is pressed, before going into non-stop mode
and returning to the main (MultiPage) procedure.

<  Previous_Page Button Press >
Previous_Page Button Press

Code is inserted to execute as soon as the "Previous
Page" button is pressed, before going into non-stop
mode and returning to the prior page procedure.

<  Next_Page Button Press >
Next_Page Button Press

Code is inserted to execute as soon as the
"Next_Page" button is pressed, before going into non-
stop mode and returning to the next page procedure.
If Next_Page is pressed on the last page, the user is
placed on the first page (MultiPage) procedure.

<  Last_Page Button Press >
Last_Page Button Press

Code is inserted to execute as soon as the "Last Page"
button is pressed, before going into non-stop mode
and calling the last page procedure.

<  End of Procedure >
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  This code begins
in column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code window.

<  When Screen Field is Selected>
When Screen Field is Selected

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

<  SETUP >
SETUP

A Conditional or Computed Field with "SETUP" in
the Formula Class field is calculated once at the
beginning of the procedure before the screen field
processing LOOP.

<  GENERAL or No class (blank) >
GENERAL or No class (blank)

Calculates the formula every time any field on the
screen is completed.  The calculation code is
generated before the field setup routines at the top of
the processing LOOP.

<<THE PRINT TEMPLATE>>
THE PRINT TEMPLATE

The Print template generates a procedure that prints the report
created with the Report Formatter. This template makes no provision
for accessing data files. Fields printed on the report reflect their
value in memory at the time the procedure is executed.  The Print
template is intended for printing messages or status reports from
data already in memory.

<Formatter Support>
Formatter Support

The Print procedure in CD31.APP is pre-loaded with an empty report
layout. Local data is generated before the report structure.
Formulas are generated before the OPEN(Report) statement.

The Screen and Pulldown Menu Formatters are not supported.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  Redirect Procedure >
Redirect Procedure

Enter the name of a procedure which is called before
the report is generated to allow the user to define the
report's destination at runtime.  The Print Template
assumes that the report's destination is in
GLO:FileSpec (a global variable defined in
CD31.APP) after the Redirect Procedure is called.
Normally, the Redirect Procedure is created from the
Redirect Template.

<  View Procedure>
View Procedure

Enter the name of a procedure which is called after the
report is generated to allow the user to view the
report's output (if the user selected the SCREEN or a
FILE as the report's destination).  Normally, the View
Procedure is created from the View Template.  The
View Template assumes that the report's output
filename is in GLO:FileSpec (a global variable
defined in CD31.APP).  If the user selected a printer
port, the Print Template clears GLO:FileSpec, which
disables the View Procedure.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section >
Data Section

In the data section of the procedure after local data,
the screen and pulldown structures.  This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Setup Procedure >
Setup Procedure

After the CODE statement.  This is the first code executed upon
entering a PRINT procedure.

<  After Report OPEN before Formulas >
After Report OPEN before Formulas

After the report has been opened, and before any the
Formula fields are calculated and before anything is
printed.

<  After Formulas Before Title Page >
After Formulas Before Title Page

After the formulas are calculated, and before anything
is printed.

<  After Grand Totals Before Final Page >
After Grand Totals Before Final Page

After the Title Page and Body Detail have printed, but
before the Final Page.

<  After Final Page Before Close >
After Final Page Before Close

After the Final Page has printed, but before the Report
is closed.

<  End of Procedure >
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  This code begins
in column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code window.

<  Detail Pre-Print Code for>
Detail Pre-Print Code for

This is an implicit embedded source code window
which is executed immediately before the Body detail
band is printed. There is only one implicit Detail Pre-
Print embedded source code point in the report.

<  Detail Post-Print Code for>
Detail Post-Print Code for

This is an implicit embedded source code window
which is executed immediately after the Body detail
band is printed. There is only one implicit Detail Post-
Print embedded source code point in the report.

<Formula Classes>
Formula Classes

No formula classes are supported by this procedure Template. All
Formulas are generated once without regard to any value in the
Formula Class field.

<<THE PULLDOWN TEMPLATE>>
THE PULLDOWN TEMPLATE

The Pulldown template generates a procedure that displays a pulldown
menu used to execute other procedures. Menu items are placed in the
menu with the Pulldown Menu Formatter. Once in the Pulldown Menu
Formatter, the menu selections which execute procedures must have
the "Execute procedure" radio button selected and the procedure to
call must be entered. Optionally, source code may be entered instead
of a procedure name by deleting any procedure name and pressing the
Source button.  At least one menu item should call the RETURN
procedure to exit the Pulldown procedure.

The code generated by the Pulldown procedure template operates like
code generated from the Menu procedure template. Therefore, the
template disables all the fields in any screen that is active and
closes the pulldown menu while its selected procedures are
executing.

A pulldown menu that is designed to work with a screen must be
created by the Pulldown Menu Formatter in the procedure that
contains the screen.

<Formatter Support>
Formatter Support

The Pulldown procedure in CD31.APP is pre-loaded with an empty
pulldown menu.  Local data is generated before the pulldown menu
structure. At least one menu item must contain a menu procedure of
RETURN to exit the pulldown procedure.

Formulas are generated at the top of the keyboard loop before the
menu item edit routines.

The Screen and Report Formatters are not supported.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  Sticky Menus >
Sticky Menus

Check this box to generate code that re-selects the last
menu item the user selected upon return from the
called procedure.

<  Keep Pulldown Active >
Keep Pulldown Active

Check this box to keep the Pulldown structure active
during the execution of a Pulldown option.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source>
Embedded Source

<  Data Section >
Data Section

In the data section of the procedure after local data,
the screen and pulldown structures.  This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  Setup Pulldown >
Setup Pulldown

After OPEN(Pulldown).

<  Top of Accept Loop>
Top of Accept Loop

At the top of the screen field processing loop.

<  End of Procedure >
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  This code begins
in column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code window.

<  Pulldown Item Code for>
Pulldown Item Code for

In the CASE FIELD() structure, executed when the
menu item is selected by the user.

<Formula Classes>
Formula Classes

No formula classes are supported by this procedure Template.

<<THE REDIRECT TEMPLATE>>
THE REDIRECT TEMPLATE

The Redirect template creates a procedure which allows the user to
choose a report's destination at runtime.  The Template code itself
is very basic _ all the functionality is provided in the default
procedure in CD31.APP. There are two local variables declared which
are placed on the default screen design.  One selects the
destination and the other names the disk file if FILE is the
selected destination.

The functionality of the procedure is completely contained in the
embedded source code points for these two fields and the Ok and
Cancel buttons. Once the destination is selected, it is placed in
the GLO:FileSpec global variable (as expected by the Report and View
Templates).

< Formatter Support>
Formatter Support

The Redirect procedure in CD31.APP is pre-loaded with a default
screen design which allows the user to select any LPT or COM port,
the SCREEN, or to name a disk file to receive report output. The
Report and Pulldown Menu Formatters are not supported. Formulas are
also not supported.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section >
Data Section

In the data section of the procedure, after local data
and the screen structure.  This may be used to declare
any data which you may want to use only in your
embedded source code.

<  Setup Procedure >
Setup Procedure

After the CODE statement.  This is the first code executed upon
entering a REDIRECT procedure.

<  Setup Screen >
Setup Screen

Immediately after the OPEN(Screen) statement.

<  Top of Accept Loop>
Top of Accept Loop

At the top of the screen field processing loop.

<  End of Procedure >
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  This code begins
in column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code points.

<  When Screen Field is Selected : >
When Screen Field is Selected :

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed: >
When Screen Field is Completed:

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

Neither Formulas nor Formula Classes are supported by the Redirect
Template.

<<THE REPORT TEMPLATE>>
THE REPORT TEMPLATE

The Report template prints reports from one or multiple related data
files. File relationships, both 1:MANY and MANY:1, are automatically
handled with some restrictions.  The files used for the report are
defined in the File Schematic built in the File Schematic Definition
window.  The first file in the File Schematic is the Primary file,
all others are Secondary files.  A Secondary Child file (double
right arrow) has a 1:MANY relationship with the file to which it is
attached in the File Schematic.  A Secondary Lookup file (single
right arrow) has a MANY:1 relationship with the file to which it is
attached in the File Schematic.

The template recurses through as many levels of 1:MANY relationships
as are defined in the File Schematic, starting with the Primary
file, going down the chain of Secondary files beginning with the
first Child file of the Primary.  This generates a set of nested
LOOP structures which read all related records from each file in
turn.  The Body detail band is printed every time a record from the
lowest level Child file is read.

A second Child file of the Primary file would begin a second 1:MANY
file chain_this is not supported by this template. The Secondary
Lookup (MANY:1) relationship is supported for multiple levels below
the file (Primary or Secondary Child) to which it is related_a
lookup will generate a second lookup from it.

This File Schematic is directly supported:

        Primary
        +-> Secondary (Lookup from Primary)
           +-> Secondary (Lookup from Lookup)
        +-> Secondary (Lookup from Primary)
        +->> Secondary (Child of Primary)
            +-> Secondary (Lookup from Secondary Child)
            +-> Secondary (Lookup from Lookup)
            +->> Secondary (Child of Secondary Child)
                +-> Secondary (Lookup from Secondary Child)


This File Schematic is NOT directly supported:

        Primary
        +-> Secondary (Lookup from Primary)
           +->>Secondary (Child of Lookup) - NO Children of Lookups
        +->> Secondary (Child of Primary)
           +-> Secondary (Lookup from Secondary Child)
        +->> Secondary (Child of Primary) - NO 2nd Child chains

This template supports multiple Group Breaks per Primary or
Secondary Child file.  The code to print the group break is
generated as a ROUTINE called from within the nested LOOP structure
after a record is read from the file for which the group break is
defined.

Record filters are supported on the Primary and every Secondary
Child file (see the Formula Class topic below). Multi-Up labels are
supported - they must be defined in the Body Detail band.

<Formatter Support>
Formatter Support

The Report procedure in CD31.APP is pre-loaded with an empty report
layout. Line counter, Page counter, and Report Device variables are
defined in local data, and the Report Properties window uses these
local variables (the line counter is required by the template).
GENERIC PRINTER is the default printer selected from the PRINTER.CTL
file.

If you place anything in the Title Page band and intend that it
should print without first printing the Page Header (or Footer), you
must check the ALONE attribute in the Title Page's Band Properties
window.

The Screen Formatter contains a default screen which is included in
the generated source code only if the Show Report Progress box is
checked.  The screen contains display-only fields for the Line
Counter and Page Counter.  The values in these two fields are
displayed after each PRINT statement in the Report.

The Pulldown Menu Formatter is not supported by the Report Template.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  Enable ESC Key Abort>
Enable ESC Key Abort

Check this box to include code to allow the user to
abort the report at runtime by pressing the ESC key.

<  Show Report Progress>
Show Report Progress

Check this box to display the screen defined in the
Screen Formatter as the report is being generated.
This allows the user to clearly see that the report is
being generated (especially if it is directed to a disk
file).

<  CLEAR Record First >
CLEAR Record First

Check this box to issue a CLEAR statement for the
Primary file before the SET statement which initiates
sequential processing.  This allows you to choose
between initializing key fields in the Report
procedure, or calling the Report from another
procedure which allows the user to select or input the
correct key field starting values.

<  Primary File Access >
Primary File Access

Select the radio button which defines the type of
access you want to the Primary file.  If you select
Keyed Order, the Primary file's Access Key set on the
Field Selection window is used to access the file and a
Range Limit Field may be specified.  If you select
Record Order, the Primary file is accessed in physical,
record-number, order and any Range Limit Field is
ignored.

<  Range Limit Field>
Range Limit Field

The records to be printed from the Primary file can be
limited by fixing the value of a component of the
Primary file access key.  Only those records whose
key component value is equal to the value in the
Range Value Field will be printed.  You must select a
key component field of the Primary file's access key
you defined in the File Schematic.

<  Range Value Field>
Range Value Field

Select the field which, at run-time, will contain the
value to which you want the report's Primary file to be
limited.

The value in this field will be assigned to the key
component field you specified in the Range Limit
Field before the SET statement for the Primary file.

<  Redirect Procedure >
Redirect Procedure

Enter the name of a procedure to call before the report
is generated to allow the user to define the report's
destination at runtime.  The Report Template assumes
that the report's destination is in GLO:FileSpec (a
global variable defined in CD31.APP) after the
Redirect Procedure is called.  Normally, the Redirect
Procedure is created from the Redirect Template.

<  View Procedure>
View Procedure

Enter the name of a procedure to call after the report is
generated to allow the user to view the report's output
(if the user selected the SCREEN or a FILE as the
report's destination).  Normally, the View Procedure
is created from the View Template.  The View
Template assumes that the report's output filename is
in GLO:FileSpec (a global variable defined in
CD31.APP).  If the user selected a printer port, the
Report Template clears GLO:FileSpec, which disables
the View Procedure.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section >
Data Section

In the data section of the procedure, after local data
and the report structure.  This may be used to declare
any data which you may want to use only in your
embedded source code.

<  Setup Procedure >
Setup Procedure

After the CODE statement.  This is the first code executed upon
entering a REPORT procedure.

<  After Report OPEN before Title Page >
After Report OPEN before Title Page

After all files in the report are opened and the report is
opened, but before anything is printed.

<  Immediately before SET(key,key) >
Immediately before SET(key,key)

Immediately after the Range Value Field has been
assigned to the Range Limit Field and before the SET
statement which establishes the report's starting
position in the file.  This allows you to correctly
initialize any other fields in the Primary File Access
Key before the SET statement.  If Range Limit and
Range Value Fields are not specified, no source code
is generated from this Embedded Source Code Point.

<  Before Primary LOOP after SET >
Before Primary LOOP after SET

After the SET statement which sets up the order and
starting point on the Primary file, but before the
LOOP which processes the Primary file records.

<  Top of Primary LOOP >
Top of Primary LOOP

Immediately after the LOOP statement which
processes the Primary file and before any other
statement in the LOOP. Code placed here executes
every time through the LOOP.

<  In Primary LOOP immediately after NEXT>
In Primary LOOP immediately after NEXT

Code placed in this window executes immediately
after each Primary file record is read and before any
group break code is executed.  If you code your own
record filter at this point instead of using a
Pre:FILTER class Formula, it would be a good idea to
check ERRORCODE() to detect the end of file
condition (if you don't, you could create an infinite
loop).

<  In Primary LOOP after NEXT before Lookups>
In Primary LOOP after NEXT before Lookups

Code placed in this window executes after each
Primary file record is read and any group break code
is executed, but before any Record Filter, Lookups, or
Formulas.

<  In Primary LOOP after Lookups >
In Primary LOOP after Lookups

Code placed in this window executes after any Record
Filter, Lookups, or Formulas from the Primary file,
but before any related Child records are accessed.

<  After Primary LOOP before Grand Totals and Final Page>
After Primary LOOP before Grand Totals and Final Page

Code placed in this window executes after all records
from all files have been processed, but before the
Grand Totals and Final Page bands are printed.

<  End of Procedure >
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  At this point, the
Report is closed.  This code begins in column one,
therefore you may use this window to write any
ROUTINEs which are called from any other
Embedded Source Code Point.

<  When Screen Field is Selected >
When Screen Field is Selected

The Report Template does not support screen
processing during generation of the report.  Code
placed here is not generated.

<  When Screen Field is Completed >
When Screen Field is Completed

The Report Template does not support screen
processing during generation of the report.  Code
placed here is not generated.

<  Group Header Pre-Print Code for>
Group Header Pre-Print Code for

This is an implicit embedded source code window
which is executed immediately before the header for
the group break referenced is printed.  There is one
implicit Group Header Pre-Print embedded source
code window for each group break defined in the
Report Formatter.

<  Group Header Post-Print Code for>
Group Header Post-Print Code for

This is an implicit embedded source code window
which is executed immediately after the header for the
group break referenced is printed.  There is one
implicit Group Header Post-Print embedded source
code window for each group break defined in the
Report Formatter.

<  Group Footer Pre-Print Code for>
Group Footer Pre-Print Code for

This is an implicit embedded source code window
which is executed immediately before the footer for
the group break referenced is printed.  There is one
implicit Group Footer Pre-Print embedded source
code window for each group break defined in the
Report Formatter.

<  Group Footer Post-Print Code for>
Group Footer Post-Print Code for

This is an implicit embedded source code window
which is executed immediately after the footer for the
group break referenced is printed.  There is one
implicit Group Footer Post-Print embedded source
code window for each group break defined in the
Report Formatter.

<  Detail Pre-Print Code for>
Detail Pre-Print Code for

This is an implicit embedded source code window
which is executed immediately before the Body detail
band is printed. There is only one implicit Detail Pre-
Print embedded source code window in the report.

<  Detail Post-Print Code for>
Detail Post-Print Code for

This is an implicit embedded source code window
which is executed immediately after the Body detail
band is printed. There is only one implicit Detail Post-Print
embedded source code window in the report.

<Formula Classes>
Formula Classes

<  SETUP>
SETUP

A Conditional or Computed Field with "SETUP" in
the Formula Class field is calculated once at the
beginning of the procedure, immediately after the
"After Report OPEN before Title Page" embedded
source point.

<  Pre:FILTER>
Pre:FILTER

The prefix of the Primary or a Secondary Child file
(not a Lookup file) with :FILTER appended
(Pre:FILTER): This creates a record filter to skip over
records in which the filter expression does not
evaluate as true, just after the file's record is read.
Only the Formula expression (in a Computed Field),
or the Condition expression (in a Conditional Field) is
used to generate the filter expression. No other
information from the Formula field is used in the filter
(any If True or If False expressions are ignored and
the Field Name is not used _ this may be a "dummy"
field).

<  FileName>
FileName

The name of the Primary or a Secondary Child file
(not a Lookup file) in the File Schematic.  This
calculates the formula only when a record read from
the named file _ this comes after any Pre:FILTER
expression on the file is evaluated and any Lookup
records are read.

<  BreakField>
BreakField

The name of a Group Break field (including prefix).
This calculates the formula just before the Group
Footer is printed.  This is useful for formulas
calculating expressions which include one or more
Report Total fields.  The formula's destination
variable should be placed in the group footer.

<  GENERAL or No class (blank) >
GENERAL or No class (blank)

Calculates the formula every time a record is read
from any file.

<<THE SCREEN TEMPLATE>>
THE SCREEN TEMPLATE

The Screen template generates a procedure that processes a screen
created with the Screen Formatter.  The template generates code for
Range checks and enforces `Must be in File' from the dictionary. The
Screen template is intended for displaying status windows or
updating memory variables.

<Formatter Support>
Formatter Support

The Screen procedure in CD31.APP is pre-loaded with an empty screen
layout. Local data is generated before the screen structure. If a
pulldown structure has been created by the Pulldown Menu Formatter, it is
generated after the screen structure.  The template makes no
provision for opening or closing a pulldown menu.  Such statements
must be entered as embedded source.  Statements from the Formula
Formatter are generated at the top of the keyboard loop before the
field setup routines. The Report Formatter is not supported.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source>
Embedded Source

<  Data Section >
Data Section

In the data section of the procedure, after local data
and the report structure.  This may be used to declare
any data which you may want to use only in your
embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the template generated interprocess communication
code.

<  Setup Screen >
Setup Screen

After OPEN(Screen).

<  Top of Accept Loop>
Top of Accept Loop

At the top of the screen field processing loop.

<  End of Procedure >
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  At this point, the
screen is closed.  This code begins in column one,
therefore you may use this window to write any
ROUTINEs which are called from any other
embedded source code window.

<  When Screen Field is Selected>
When Screen Field is Selected

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed >
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

No formula classes are supported by this procedure Template. All
formulas are generated within the main LOOP before the ACCEPT
statement.

<<THE SOURCE TEMPLATE>>
THE SOURCE TEMPLATE

The Source template generates a procedure comprised only of embedded
source code.  All executable statements in the procedure, must be
entered at the embedded source point labeled All Executable Source
Code. The source entered must contain (at least) a RETURN statement.
The Source template is intended for procedures that cannot be
generated by any other template.

<Formatters Supported>
Formatters Supported

The Source template does not support the Application Generator's
Screen, Report, Pulldown Menu, or Formula formatters.  However, the
Text Editor's Screen, Report, and Pulldown Menu Formatters can be
invoked while entering embedded source in the Data Section.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  NO Global Vars Code>
NO Global Vars Code

Several of the Clarion for DOS 3.1 Templates use inter-process
communication code based on the global variables: GlobalRequest
and GlobalResponse.  The Source Template default is for local code
to be generated to initialize and set values accordingly, upon
entry and exit to the Source procedure/function.

Checking the 'NO Global Vars Code' check box ON disables the local
code generation of the inter-process communication code (for this
Source procedure/function only).

<Embedded Source>
Embedded Source

<  Data Section >
Data Section

In the data section of the procedure, after local data.
This may be used to declare any data which you may
want to use in your embedded source code.

<  All Executable Source Code >
All Executable Source Code

All executable statements in the procedure must go in
here.

<Formula Classes>
Formula Classes

No formula classes are supported by this procedure Template. Formula
fields are not supported.

<<THE TABLE21 TEMPLATE>>
THE TABLE21 TEMPLATE

The Table21 template generates a procedure that scrolls data files
on the screen like a spreadsheet.  Unlike the List or Browse
templates, the Table uses a REPEAT structure instead of a list box.

The Table21 Template is provided for compatibility with the Clarion
Professional Developer version 2.1-style TABLE procedures. When you
import a TABLE procedure from a 2.1 .APP file, this template is
used. Keystrokes for insert, change, and delete are retained.

<Formatter Support>
Formatter Support

The Table21 procedure in CD31.APP is pre-loaded with a screen layout
with a REPEAT structure containing a POINT field. The Report
Formatter is not supported.

<Procedure Properties>
Procedure Properties

<  Procedure Title>
Procedure Title

Enter the procedure's Title.

<  Setup Procedure>
Setup Procedure

Enter the Procedure to call at the beginning of the
procedure.

<  Update Procedure>
Update Procedure

Enter the name of the Update Procedure to use to
insert, change, or delete records.

<  Record Selector>
Record Selector

Enter a key field component to use to limit the
displayed records. Only those records whose key field
component contains a value matching the value in this
field at the beginning of the procedure are displayed.

<  Record Filter>
Record Filter

Enter a valid expression to filter out invalid records.
Only those records that meet the filter criteria are
displayed.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section>
Data Section

In the data section of the procedure after local data,
the screen and pulldown structures.  This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Immediately After CODE Statement>
Immediately After CODE Statement

Immediately after the CODE statement.  This is the first code
executed upon entering the procedure.

<  Setup Procedure>
Setup Procedure

Immediately after the 'Setup Procedure' prompt code. The Conversion
places the original 2.1 'Setup Procedure' code into the 'Setup
Procedure' prompt.  This embed enables additional code to be
generated following the 'Setup Procedure' prompt code.

<  Setup Screen >
Setup Screen

At the beginning of the procedure, after the
OPEN(Screen) statement.

<  Before the ACCEPT Statement>
Before the ACCEPT Statement

Immediately before the ACCEPT statement.

<  After the ACCEPT Statement>
After the ACCEPT Statement

Immediately after the ACCEPT statement.

<  Beginning of FILL_TABLE>
Beginning of FILL_TABLE

At the beginning of the FILL_TABLE ROUTINE.

<   End of FILL_TABLE>
End of FILL_TABLE

At the end of the FILL_TABLE ROUTINE.

<  Beginning of FILL_RECORD>
Beginning of FILL_RECORD

At the beginning of the FILL_RECORD ROUTINE.

<  End of FILL_RECORD>
End of FILL_RECORD

At the end of the FILL_RECORD ROUTINE.

<  Beginning of FILL_SCREEN>
Beginning of FILL_SCREEN

At the beginning of the FILL_SCREEN ROUTINE.

<  End of FILL_SCREEN>
End of FILL_SCREEN

At the end of the FILL_SCREEN ROUTINE.

<  When Screen Field is Selected>
When Screen Field is Selected

In the CASE SELECTED() structure, executed when
the field has been selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<  Custom Routines>
Custom Routines

Use this window to write any ROUTINEs which are
called from any other embedded source code window.

<Formula Classes>
Formula Classes

<  Display Computed>
Display Computed

Calculates the formula every time any field on the
screen is completed.

<  Display Conditional>
Display Conditional

Calculates the formula every time any field on the
screen is completed.

<  Scrolling Computed>
Scrolling Computed

Calculates the formula for display in the scrolling
area.

<  Scrolling Conditional>
Scrolling Conditional

Calculates the formula for display in the scrolling
area.

<  GENERAL or No class (blank) >
GENERAL or No class (blank)

Calculates the formula every time any field on the
screen is completed.  The calculation code is
generated before the field edit routines at the top of
the field processing code.

<<THE TODO TEMPLATE>>
THE TODO TEMPLATE

The ToDo template should not be selected for code generation.
Procedures, when first referenced, are automatically created as ToDo
until the template for code generation is selected. No operation
"stub code" is generated for procedures which remain as ToDo at
source generation time.

<<THE VIEW TEMPLATE>>
THE VIEW TEMPLATE

The View Template displays any ASCII text file in a scrolling list
box. It is normally used to display a report to the screen that was
previously written to disk. The View template may be used to create
a procedure which is the Next Procedure of a File template.  This
will allow the user to select a file to view from a list of
available files.

The text will scroll up or down using the up and down arrow keys or
the vertical scroll bar. Pressing the right mouse button in the top
half of the list box scrolls up and in the bottom half scrolls down.
Left and right scrolling is supported with END, HOME, the horizontal
scroll bar, or the LEFT ARROW and RIGHT ARROW keys.

The DOS File definition is defined in the template. The record (one
line of the report) is defined with a length of 255.

If Progress Indicator is checked on then a message will be displayed
to the user while reading the file from disk. This is recommended
for larger reports to let the user know that the program is still
active while reading the file from disk. While reading the file from
disk, the scrolling keys may be used (PGUP, PGDN, UP, DN, etc...) to
scroll the queue.  The mouse cursor will not be active until the
entire file has been read. No changes are required in the Screen
Formatter or the Data Section.  To use the template, just indicate
the name of the DOS file to display.

<Formatter Support>
Formatter Support

The Screen Formatter is available for this template and is preloaded
with a default SCREEN.  The LIST box and Exit button are required.
The LIST box may be resized or positioned.

The SCREEN has three buttons: Exit, Print and 25/50 Mode. The Exit
button is required and may not be removed.  The field equate label
must be ?Exit.

The Print button prints the file being viewed. A print device field
is activated to allow the user to select the output device.  If the
Print button is deleted, the PrintDevice field must also be deleted.

The 25/50 Mode button attempts to toggle the current text mode
between 25 and 50 line mode.  The SCREEN will be re-opened in the
new mode and the list box will be expanded, since the screen
structure in the default application file has an EXPAND attribute
with row 10 identified as the row to duplicate.  Since the SETTEXT
statement is used, the mode will be changed to the closest match.
For EGA systems the closest match to 50 line mode will be 43 line
mode.  This button may be removed from the SCREEN structure to
disable video mode switching.

The Report Formatter is not available.

<Procedure Properties>
Procedure Properties

<  Prototype>
Prototype

Enter the procedure's prototype (all except the procedure's name) to
be placed in the program's MAP structure. For example, if your
procedure is a FUNCTION called MyProc and it will receive two
parameters - a STRING and a BYTE passed by address - and return a
STRING, you would enter :

              (STRING,*BYTE),STRING

NOTE: The parentheses enclosing the parameter list are required.

See FUNCTION and PROCEDURE Prototypes in the Language Reference for
a discussion of valid prototypes.

<  Parameter List>
Parameter List

Enter the complete parameter list (including parentheses) to be
placed on the procedure's PROCEDURE or FUNCTION statement. The
number of parameters should match the number of parameters defined
in the procedure's prototype above.  This labels the passed
parameters for reference within the procedure. For the above
example, you could enter:

        (Fred,Joe)

The generated source code for the procedure would look like:

           MyProc  FUNCTION(Fred,Joe)

In your executable code, you would reference the STRING parameter as
"Fred" and the BYTE as "Joe."

NOTE: The parentheses enclosing the parameter list are required.

<  Return Value>
Return Value

Specify a return value for a function.  If the prototype describes
a function then the variable which contains the return value should
be specified, otherwise, if the prototype describes a procedure then
this entry must be blank.

The value is used to construct a RETURN(returnvalue) statement for
the function.

<  File to View>
File to View

This is the ASCII file to be displayed in the list box. It
may be a string constant or a variable. If it is a
constant it should be enclosed in `quotes'. If it is a
variable, the variable should be declared in the Global
Data Section of the program.

When left blank, a variable from the default
application is used (GLO:Filespec in CD31.APP).
This is the same default variable used in the File
template.

<  Warning Size (in K)>
Warning Size (in K)

The View template will read the entire file into a
Queue for runtime performance.  However, If you
have a file larger than the assigned virtual memory
block (Queue elements are saved in virtual by default
unless virtual memory support is turned
off) the Queue may be written to disk.  This may
substantially slow the scrolling of the file.  A warning
screen may be displayed when a selected file is larger
than a specified size.  This size will be multiplied by
1024 and compared against the actual file size.

<  Maximum Line Length>
Maximum Line Length

Most reports will not be wider than 80 or 132
columns. This allows an opportunity to check for files
which do not typically have a carriage return / line
feed combination in the first X number of characters
(like .EXE and .COM files).

The number entered here will be used to check the
number of bytes in each ASCII file record as it is read.
If a line read has more than the number of characters
which are specified as the maximum, an error window
will appear and the view will be aborted.  Typically
for an .EXE file this will occur in the first record read
and no `garbage' will be displayed in the list box.  If
no Maximum Line Length is entered, the default of
200 is used.

<  Progress Indicator >
Progress Indicator

If this box is checked on, a message will be displayed
to the user while the file is read from disk.

<  Progress Character>
Progress Character

You may enter the ASCII character to be used as the
`bar.' Easy entry of high order ascii characters may be
made by using the ASCII value found in the ASCII
chart from the Tools menu.  The ASCII value should
be surrounded by angle brackets within single quotes.
The Default Application file is preloaded with a
shaded bar character `<176>'.

<  GUI Settings...>
GUI Settings...

The GUI Settings... button displays a page of promts which allow
you to set Clarion for DOS Graphical User Interface (GUI) local
template settings.  Local 'GUI Settings' override an application's
global GUI settings for a specific procedure.

All local 'GUI Settings' buttons are enabled ONLY when the global
'GUI Settings' check box 'Enable GUI Mode' is ON (please see
IMPORTANT NOTE below).

IMPORTANT NOTE:
==============
In order to take advantage of template 'GUI Settings', you must have
Clarion for DOS 3.1 (Release 3101 or greater) in addition to the
Clarion for DOS GUI 3.1 Add-On product (Release 3101 or greater). If
you do not have either product release, then contact TopSpeed
Corporation for information.

The CFDGUI.TPL Template file included with CFD GUI (Release 3101 or
greater) should be specified as an application's 'Template File' on
the 'Application Properties' screen.  The CFDGUI.TPL template file
has its own CFDGUI.APP Default APP which contains the default GUI
screens and prompt settings which are appropriate for instantiating
new procedures in a GUI application.  Also, the CFDGUI.TPL file
contains all of the template code required to make a procedure's
'GUI Settings' work.

An example application which demonstrates the CFD GUI capabilities
is included on your installation disks.

<Embedded Source Code Points>
Embedded Source Code Points

<  Data Section >
Data Section

In the data section of the procedure before local data,
the screen and pulldown structures.  This may be used
to declare any data which you may want to use only in
your embedded source code.

<  Setup Procedure >
Setup Procedure

After the CODE statement.  This is the first code executed upon
entering a VIEW procedure.

<  Setup Screen >
Setup Screen

After OPEN(Screen).

<  Top of Accept Loop>
Top of Accept Loop

At the top of the screen field processing loop.

<  Immediately Before RETURN for non-ASCII file error>
Immediately Before RETURN for non-ASCII file error

When the procedure detects that a line is longer than
the maximum specified by the Warning Size it returns
to the caller with an error message.

<  After NEXT in RptFile Loop >
After NEXT in RptFile Loop

In the loop that read the DOS file from disk, after the
NEXT statement.

<  Immediately After LOOP, before FREE(Queue)>
Immediately After LOOP, before FREE(Queue)

After the screen processing loop is complete,
indicating the user is finished viewing the text.  The
queue still contains the text at this point.

<  End of Procedure >
End of Procedure

Code placed in this window executes after all other
code in the procedure has executed.  This code begins
in column one, therefore you may use this window to
write any ROUTINEs which are called from any other
embedded source code window or code that should be
execute at the end of the procedure.

<  When Screen Field is Selected >
When Screen Field is Selected

In the CASE SELECTED() structure, executed when
the field is selected for entry.

<  When Screen Field is Completed>
When Screen Field is Completed

In the CASE FIELD() structure, executed when the
field has been completed.

<Formula Classes>
Formula Classes

No formula classes are supported by this procedure Template.

