home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR36
/
C7101.ZIP
/
MISCGRPS.TPX
< prev
next >
Wrap
Text File
|
1994-01-28
|
15KB
|
236 lines
#!┌───────────────────────────┤Template Segment├───────────┬─────────────────┐
#!│ MiscGrps.TPX │Version: 3007.000│
#!├───────────────────────────────┤Contents├───────────────┴─────────────────┤
#!│Structure Type Description │
#!│──────────────────── ───────── ─────────────────────────────────────────│
#!│StandardHeader GROUP │
#!│GenerateFormulas GROUP │
#!│GenerateFormula GROUP │
#!│GetSecondaryRecords GROUP │
#!│HotKeyRoutines GROUP │
#!│PulldownEditRoutines GROUP │
#!├───────────────────────────────┤Comments├─────────────────────────────────┤
#!│Version Comments │
#!│──────── ────────────────────────────────────────────────────────────────│
#!│3007.000 Release of CDD3 version 3007 templates │
#!└──────────────────────────────────────────────────────────────────────────┘
#!
#GROUP(%StandardHeader)
#!
#!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
#!│ StandardHeader │Version: 3007.000│
#!├──────────────────────────────┤Description├─────────────┴─────────────────┤
#!│Purpose: Standard procedure header │
#!│Called From: All #Procedures │
#!│Assumptions: None │
#!│Inserts: None │
#!│Symbols Set: None │
#!│Notes: None │
#!├───────────────────────────────┤Comments├─────────────────────────────────┤
#!│Version Comments │
#!│──────── ────────────────────────────────────────────────────────────────│
#!│3007.000 Release of CDD3 version 3007 templates │
#!└──────────────────────────────────────────────────────────────────────────┘
#!
OMIT('╝')
╔════════════════════════════════════════════════════════════════════════════╗
#IF(%ProcedureDescription)
║ %Procedure - %ProcedureDescription - %ProcedureTemplate #<!Generated Procedure ║
#ELSE
║ %Procedure - (No Description) - %ProcedureTemplate #<!Generated Procedure ║
#ENDIF
#IF(%Screen) #! If a Screen Structure Exists
║ Screen Structure Defined ║
#ELSE
║ Screen Structure NOT Defined ║
#ENDIF
#IF(%PullDown) #! If a Pulldown Structure Exists
║ PullDown Structure Defined ║
#ELSE
║ PullDown Structure NOT Defined ║
#ENDIF
#IF(%Report) #! If a Report Structure Exists
║ Report Structure Defined ║
#ELSE
║ Report Structure NOT Defined ║
#ENDIF
#IF(%Primary) #! If a Primary File Designated
║ Primary File: %Primary #<! Primary Processing File ║
#ELSE
║ Primary File: NONE ║
#ENDIF
╚════════════════════════════════════════════════════════════════════════════╝
#!
#GROUP(%GenerateFormulas)
#!
#!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
#!│ GenerateFormulas │Version: 3007.000│
#!├──────────────────────────────┤Description├─────────────┴─────────────────┤
#!│Purpose: Generate Formulas, of a specified class, and all unclassed │
#!│Called From: Most Procedure Templates, and some Groups │
#!│Assumptions: None │
#!│Inserts: GenerateFormula │
#!│Symbols Set: None │
#!│Notes: │
#!│ The formula editor generates computed fields and conditional fields. │
#!│ Computed fields assign the value of a numeric or string expression to a │
#!│ variable. Conditional fields evaluate a logical expression, then assign │
#!│ the value of a true expression or a false expression to a variable. The │
#!│ order of formulas is important because formulas may produce intermediate │
#!│ values used in later formulas. │
#!│ │
#!│ Each formula has an optional class. If the symbol %CodePosition is │
#!│ null, every formula is generated. If %CodePosition is not null, only │
#!│ formulas with matching classes are generated. │
#!├───────────────────────────────┤Comments├─────────────────────────────────┤
#!│Version Comments │
#!│──────── ────────────────────────────────────────────────────────────────│
#!│3007.000 Release of CDD3 version 3007 templates │
#!└──────────────────────────────────────────────────────────────────────────┘
#!
#FOR(%Formula)
#IF((UPPER(LEFT(%FormulaClass)) = UPPER(%CodePosition) OR %CodePosition = %NULL))
#INSERT(%GenerateFormula)
#ENDIF
#ENDFOR
#!
#GROUP(%GenerateFormula)
#!
#!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
#!│ GenerateFormula │Version: 3007.000│
#!├──────────────────────────────┤Description├─────────────┴─────────────────┤
#!│Purpose: To Write the code for Formula Computation │
#!│Called From: Most Procedure Templates, and some Groups │
#!│Assumptions: A FORMULA is Fixed (Either explicitly or through a #FOR) │
#!│Inserts: None │
#!│Symbols Set: None │
#!│Notes: │
#!│ The formula editor generates computed fields and conditional fields. │
#!│ Computed fields assign the value of a numeric or string expression to a │
#!│ variable. Conditional fields evaluate a logical expression, then assign │
#!│ the value of a true expression or a false expression to a variable. The │
#!│ order of formulas is important because formulas may produce intermediate │
#!│ values used in later formulas. │
#!│ │
#!│ This group will generate a single formula. If more than one formula │
#!│ is needed, it should be placed in a template #FOR statement: │
#!│ │
#!│ #FOR(%Formula) │
#!│ #INSERT(%GenerateFormula) │
#!│ #ENDFOR │
#!│ │
#!│ Or, if only a selected formula class is needed: │
#!│ │
#!│ #FOR(%Formula) │
#!│ #IF(%FormulaClass <> 'FILTER') │
#!│ #INSERT(%GenerateFormula) │
#!│ #ENDIF │
#!│ #ENDFOR │
#!├───────────────────────────────┤Comments├─────────────────────────────────┤
#!│Version Comments │
#!│──────── ────────────────────────────────────────────────────────────────│
#!│3007.000 Release of CDD3 version 3007 templates │
#!└──────────────────────────────────────────────────────────────────────────┘
#!
#IF(%FormulaType = 'COMPUTED')
%Formula = %FormulaComputation #<! Computed Formula
#ELSE
IF %FormulaCondition #<! IF FormulaCondition
%Formula = %FormulaTrue #<! condition is true
#IF(%FormulaFalse)
ELSE
%Formula = %FormulaFalse #<! condition is true
#ENDIF
END #<! End IF FormulaCondition
#ENDIF
#!
#GROUP(%GetSecondaryRecords) #!Get all lookup records
#!
#!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
#!│ GetSecondaryRecords │Version: 3007.000│
#!├──────────────────────────────┤Description├─────────────┴─────────────────┤
#!│Purpose: Lookup related (Many:1) records, for files that are │
#!│ listed in the File Schematic │
#!│Called From: Many Procedure Templates, and some Groups │
#!│Assumptions: None │
#!│Inserts: None │
#!│Symbols Set: None │
#!│Notes: │
#!│ There is a secondary file for every active relationship of the primary │
#!│ file. A relationship is active for a given procedure if any field in │
#!│ the secondary file is in use by the screen, report, or formula editor. │
#!├───────────────────────────────┤Comments├─────────────────────────────────┤
#!│Version Comments │
#!│──────── ────────────────────────────────────────────────────────────────│
#!│3007.000 Release of CDD3 version 3007 templates │
#!└──────────────────────────────────────────────────────────────────────────┘
#!
#FOR(%Secondary) #! for fields in the list box
#IF(%SecondaryType = 'MANY:1') #! Check for lookup files
#FIX(%File,%SecondaryTo)
#FIX(%Relation,%Secondary)
#FOR(%RelationKeyField)
#IF(%RelationKeyFieldLink)
%RelationKeyField = %RelationKeyFieldLink #<! Assign linking field value
#ENDIF
#ENDFOR
GET(%Secondary,%RelationKey) #<! Lookup record
IF ERRORCODE() THEN CLEAR(%RelationPre:Record). #<! Clear record if unsuccessful
#ENDIF
#ENDFOR
#!
#GROUP(%HotKeyRoutines)
#!
#!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
#!│ HotKeyRoutines │Version: 3007.000│
#!├──────────────────────────────┤Description├─────────────┴─────────────────┤
#!│Purpose: Write CASE structure checking for Hot Keys │
#!│Called From: Many Procedure Templates │
#!│Assumptions: None │
#!│Inserts: None │
#!│Symbols Set: None │
#!│Notes: │
#!│ The following statements generate a CASE structure to insert │
#!│ calls to any Hot Key procedures which have been identified in the │
#!│ Screen Formatter. │
#!├───────────────────────────────┤Comments├─────────────────────────────────┤
#!│Version Comments │
#!│──────── ────────────────────────────────────────────────────────────────│
#!│3007.000 Release of CDD3 version 3007 templates │
#!└──────────────────────────────────────────────────────────────────────────┘
#!
#IF(%HotKeyCaseRequired)
CASE KEYCODE()
#FOR(%HotKey)
OF %HotKey #<! User defined HotKey
%HotKeyProc #<! HotKey Procedure
#ENDFOR
END
#ENDIF
#!
#GROUP(%PulldownEditRoutines)
#!
#!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
#!│ PulldownEditRoutines │Version: 3007.000│
#!├──────────────────────────────┤Description├─────────────┴─────────────────┤
#!│Purpose: Generate OF ?xxx statements for CASE FIELD() structures │
#!│ in procedures that use a Pulldown │
#!│Called From: Many Procedure Templates │
#!│Assumptions: None │
#!│Inserts: None │
#!│Symbols Set: None │
#!│Notes: None │
#!├───────────────────────────────┤Comments├─────────────────────────────────┤
#!│Version Comments │
#!│──────── ────────────────────────────────────────────────────────────────│
#!│3007.000 Release of CDD3 version 3007 templates │
#!└──────────────────────────────────────────────────────────────────────────┘
#!
#FOR(%PulldownField) #! add all procedure or
#IF(%PulldownFieldType = 'PROCEDURE') #! source code calls
OF %PulldownField #<!For a Pulldown field
%PulldownFieldProc #<! execute its procedure
#ENDIF
#ENDFOR
#CHAIN('RptGrps.TPX')