App Builder 2 Scripting Tools
App Builder 2 Scripting Tools
BluePhoenix AppBuilder 2.1.0. Scripting Tools Reference Guide April, 2003 Corporate Headquarters BluePhoenix Solutions Vlierwerf 7B 4704 SB Roosendaal The Netherlands +31 (0) 165 399 401 +31 (0) 165 396 308 fax USA Headquarters BluePhoenix Solutions USA, Inc. 8000 Regency Parkway Cary, NC 27511 United States +1 919.380.5100 +1 919.380.5111 fax www.bluephoenixsolutions.com
1992-2003 BluePhoenix Solutions All rights reserved. BluePhoenix is a trademark of BluePhoenix Solutions. All other product and company names mentioned herein are for identification purposes only and are the property of, and may be trademarks of, their respective owners. Portions of this product may be covered by U.S. Patent Numbers 5,495,222 and 5,495,610 and various other non-U.S. patents. The software supplied with this document is the property of BluePhoenix Solutions, and is furnished under a license agreement. Neither the software nor this document may be copied or transferred by any means, electronic or mechanical, except as provided in the licensing agreement. BluePhoenix Solutions has made every effort to ensure that the information contained in this document is accurate; however, there are no representations or warranties regarding this information, including warranties of merchantability or fitness for a particular purpose. BluePhoenix Solutions assumes no responsibility for errors or omissions that may occur in this document. The information in this document is subject to change without prior notice and does not represent a commitment by BluePhoenix Solutions or its representatives.
TABLE OF CONTENTS
Table of Contents
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Flow Diagrams Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 Using Conventions and Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 Reading a Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 Inserting Multiple-line and Single-line Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 Template Language Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 TEMPLATE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 USAGES Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5 HIERARCHY Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6 RULE Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9 WINDOW Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12 Other Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16 COMPONENT Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16 FLATFILE Block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16 KEYWORDS Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17 TEXT Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17 USE ANY Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17 DIALOG Block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17 Template Block Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21 Declaring Local Variables from Any Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21 Making Any Block a Callable Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21 Other Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23 CALL Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23 CALL SERVICE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24 SELECT Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24 APPEND and REMOVE Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25 TRAVERSE Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25 UPDATE MESSAGE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27 SHOWMESSAGE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27 SET Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28 Supporting Statements and Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28 Common Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29 Conditional Expression (conditional_expr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31 Integer Expression (int_expr). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34 List Expression (list_expr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36 Object Expression (object_expr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38 String Expression (string_expr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-43
ii
Processing Symbols on an Open Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-45 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48 Get and File Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48 String Manipulation Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-50 Superseded Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-52 Template Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-52 SQL Delete Rule Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-53 Detail Display Rule and Window Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-55
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
Table of Contents
iii
iv
CHAPTER
TurboScripter provides a scriptable repository interface that can be accessed from the AppBuilder Construction Workbench or from other tools through COM. VBScript (VisualBasic) or JScript (Java) provide the required language functionality to access the properties and methods of these objects. This guide contains information on using the scripting tools available in AppBuilder TurboScripter and TurboCycler. It begins with a discussion of TurboScripter and includes the necessary reference information for using it. Because of the similarity to VisualBasic (VB) scripting, it does not include detailed procedures. The rest of the guide involves the use of the TurboCycler scripting tool. It begins with instructions on using the TurboCycler Standard Edition default templates, followed by a description of the TurboCycler Developers Kit, which you use to create your own templates. Use of this guide assumes user familiarity with a scripting language.
Note
If you are making a call to an Excel spreadsheet object, Excel must be running or you will get an error.
To learn the details of the TurboScripter object model, read the TurboScripter Object Reference.
TurboScripter Overview
TurboScripter provides you with a mechanism to write scripts in VBScript or JavaScript that can access the repository, manipulate repository objects, and access other applications that function through automation, such as Microsoft Word. Tools within the Construction Workbench have menu options to invoke TurboScripter and pass repository objects to it. The tools you use to build applications using TurboScripter are documented throughout this manual. Topics in this section include: TurboScripter Object Reference Valid Domain Types and Values FAQs for Scripting Tools
Note
Installation of TurboScripter includes the installation of a number of sample scripts. When a particular object is used in one of the sample scripts, that script is identified below.
1-1
1-2
Commit()
The entire session is committed. When called from the WorkBench, changes done by the other tools are also committed. Sample: Create.vbs
Warning
The script author should take care to ensure that objects that have been deleted before are not accessed after the commit. This could destabilize the workbench.
Rollback()
The entire session is rolled back. When called from the WorkBench, changes done by the other tools are also rolled back. Sample: Create.vbs
Warning
The script author should take care to ensure that objects that have been deleted before are not accessed after the rollback. This could destabilize the workbench. Rollback does not remove all unwanted objects after cloning by TurboCycler.
GetEntityTypes()
Returns a Dictionary object containing all the entity types in the repository as strings. This list is keyed by the index starting from 0. Sample: Model.vbs
1-3
GetRelationTypes()
Returns a Dictionary object containing all the relation types in the repository as strings. This list is keyed by the index of the elements in the list starting from 0. Sample: Model.vbs
GetPropertyNames(String ObjectType)
Returns a Dictionary object containing all the property names for this object type. This list is keyed by the index of the elements in the list starting from 0. Sample: Model.vbs
1-4
CreateChild(String Type, String Name, String RelationType, (optional) Dictionary Properties, (optional) Dictionary RelationProperties)
Creates a child object of the specified Type and Name. The Properties Dictionary can contain the properties of the child object while the RelationProperties Dictionary can contain the properties of the relation, for example, Sequence Number of the relation. If the specified object already exists in the repository, this method returns the retrieved object. Sample: Hierarch.vbs
GetType()
Returns the Object Type name of this object as a String. Sample: gettype.vbs
GetFile(Integer FileType)
Returns the File associated with this object. Valid values for File Type are given below. Example: If this is a Rule object, then GetFile(7) will return the source file for this rule as a string. 0(RepoText) is a valid file type for all Entity (TSEnt) and Relation (TSRel) objects. 1(RepoKeywords) is a valid file type for all TSEnt objects. Sample: Rename.vbs
Table 1-1 File Type Values RepoText = 1 ReportSection = 3
RepoKeywords = 0 WindowPanel = 2
1-5
Table 1-1
File Type Values (Continued) DrawingFile = 5 RuleSource = 7 WindowHelp = 9 ServerOptions = 11 FormContents = 13 ClosureScope = 15 ComponentFolderFile = 17
1-6
GetType()
Returns the Relation Type name of this relation as a String. Sample : gettype.vbs
GetFile(Integer FileType)
Returns the File associated with this object. Sample : ExtraceFromFolder.vbs Example: If this is a COMPONENT_FOLDER_CONTENT object, then GetFile(17) will return the component folder file for this relation object as a string if it is a text file.
Level
A integer property that specifies the severity of the messages that need to be written to the trace file. The valid values are:
1-7
Trace Levels
Trace File Contents Trace errors Trace errors and informational messages Trace detailed error and information messages Note that this value significantly impacts performance.
TRACE_EXECUTION, TRACE_DEBUG, and TRACE_ALL are integer constants defined in the TSATL type library. Any other numeric value above 2 is the same as setting the value to 2.
1-8
ScriptRun(String ScriptFileName, String Language, Dictionary InputObjects, Long WindowHandle, (optional) Dictionary TopLevelObjects)
Executes the specified script. Returns an error on failure. VBScript and JScript are the currently supported languages. The Window Handle can be 0 in which case, the handle of the currently active window will be used. The TopLevelObjects Dictionary contains ActiveX objects keyed by their name. These objects can be used from inside a script just like the default Top Level Objects like Trace or Repo.
ScriptletRun(String ScriptContents, String Language, Dictionary InputObjects, Long WindowHandle, (optional) Dictionary TopLevelObjects)
Works the same way as ScriptRun except that a string containing the script is passed instead of the file name. This is useful when scripts are generated on the fly by an application.
1-9
Top-level objects added by TurboScripter to the scope of all scripts: Repository Object Implements IRepo Repository Object for querying, creating or deleting objects in the repository Trace Object Implements Itrace Trace Object to get and set the trace file and trace level Host Object - Implements IScriptUtils Host Object to enable creating a child script Input or Entity Object Implements ITSEnt Dictionary object that contains the input Entity objects (TSEnt). Sample:Rename.vbs.
CoDraw Object
The CoDraw Object provides access to Drawing Objects stored in the repository. Currently only read access is allowed. From VB or TurboScripts, Drawing Objects can be accessed by calling CreateObject(CoDrawFile.CoDrawFile). This returns the created ICoDrawfile object which can be used to perform read operations on the drawing.
GetAllRepoObjects()
Retrieves all the repository objects in the drawing and returns a Dictionary object that contains these as Entity objects (TSEnt). Sample: Draw.vbs
GetRepoObjects(String Type)
Retrieves the repository objects of the specified Type in the drawing and returns a Dictionary object that contains these as TSEnt objects. Sample: Draw.vbs
Note
The CoDraw object reflects the state of the Drawing Object as it is in the repository. If changes are made to the drawing file from the workbench, these changes need to be committed before the CoDraw Object is opened.
1-10
CoPanel Object
The CoPanel object provides COM/OLE Automation-based access to the various controls and their properties. It allows a TurboScript to create, read, update and delete the controls and their properties. They include: CoPanel Object Control Types CoPanel Object Colors CoPanel Object GUI Types
Table 1-3 CoPanel Object Control Types Constant ctrlChart ctrlCheckbox ctrlCombobox ctrlEditfield5 ctrlEllipse ctrlGroupbox ctrlHotspot ctrlListbox ctrlMultiLineEdit ctrlActiveX ctrlPushbutton ctrlRadiobutton ctrlRectangle ctrlMCLB ctrlStatictext ctrlBitmap ctrlMenu ctrlSubMenu ctrlMenuItem ctrlMenuSeparator ctrlCell ctrlCellField ctrlCellText ctrlXData ctrlYData ctrlFootingText ctrlLeftMarginText ctrlRightMarginText ctrlHeadingText
Control Type 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. CHARTWINDOW CHECKBOX COMBOBOX EDITFIELD ELLIPSE GROUPBOX HOTSPOT LISTBOX MULTILINEEDIT OLECONTROL PUSHBUTTON RADIOBUTTON RECTANGLE SPREADSHEET STATICTEXT BITMAP MENU SUBMENU MENUITEM SEPARATOR CELL CELLFIELD CELLTEXT XDATA YDATA FOOTINGTEXT LEFTMARGINTEXT RIGHTMARGINTEXT HEADINGTEXT
1-11
Table 1-4
Color 1. 2. 3. 4. 5. 6. 7. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. Default Black White DarkGray Gray LightGray DarkBlue DarkGreen Green DarkCyan Cyan DarkRed Red DarkMagenta Magenta DarkYellow Yellow Pink Brown CoPanel Object GUI Types
Workstation HTML
Note
Some functions below have Language parameter. It is introduced for future use.
AddControl(ControlType control_type)
Adds a new control of the specified control_type to the panel and returns a Control Object.
1-12 TurboScripter Object Model Reference
Sample: pnl_crt.vbs
AddAttribute(String AttrbuteName)
Adds the specified attribute to the Panel object and returns the Attribute Object. This method is called when a new attribute that is not in the current Window Model needs to be added to the panel.
DeleteAttribute(String AttributeName)
Deletes the specified attribute from the Panel object. This can be done for attributes that are currently in the Window Model, as well as new ones added by the user.
GetAttribute(String AttributeName)
Returns the Attribute Object for the specified attribute. Sample: pnl_read.vbs
DeleteControl(Control ctrl)
Deletes the control specified by the ctrl object from the panel
GetAllAttributes()
Returns a Dictionary object containing a list of all the Attribute Objects for this panel.
Rollback()
Rolls back all changes made to the panel and returns it to the NewPanel or OpenPanel state.
GetAllControls()
Returns a Dictionary object with a list of all the controls in the panel.
GetDomainValues(String Type)
Given a Domain Type, this call returns a dictionary object containing all the values in the domain. Refer to the Valid Domain Types and Values.
1-13
GetLanguage()
Retrieves that language property for the current panel object.
Paste(VARIANT objects)
Adds objects, supplied in panel file format, to the panel. Returns a Dictionary object with a list of the controls that were added.
GetDomainTypes()
GetDomainTypes() returns a dictionary of domain type strings.
GetDomainValues()
GetDomainValues() returns a dictionary of values for a given domain type. These methods are used together to provide Window Painter the valid attribute values for a given attribute. These values are contained in the Window Painter model. Refer to the Valid Domain Types and Values.
COUNTRY
Table 1-7 Country Values
1-14
Table 1-7
Country Values
BRAZIL CANADA_FRENCH CZECHOSLOVAKIA FINLAND GERMANY HUNGARY ITALY NETHERLANDS NORWAY PORTUGAL SOUTH_AFRICA SPAIN SWITZERLAND THAILAND TURKEY UNITED_STATES COORDTYPE CHAR JUSTIFICATION LEFT FORMAT CASEENTERED LOWER ALLFIRSTUPPER COLOR CUSTOM BLACK DARKGRAY LIGHTGRAY BLUE GREEN
CANADA_ENGLISH CHINA DENMARK FRANCE GREECE ICELAND JAPAN NEW_ZEALAND POLAND ROMANIA SOUTH_KOREA SWEDEN TAIWAN THAILAND_BUDDHIST UNITED_KINGDOM YUGOSLAVIA
PIXEL
RIGHT
UPPER FIRSTUPPER
1-15
CYAN RED MAGENTA YELLOW BROWN HSCROLL SHOW_ALWAYS SHOW_AS_NEEDED VSCROLL SHOW_ALWAYS SHOW_AS_NEEDED BORDER_TYPE BORDER_NONE BORDER_DIALOG FONT CUSTOM MODERN8 MODERN12 ROMAN10 ROMAN14 ROMAN24 SWISS10 SWISS14 SWISS24
SHOW_NEVER
SHOW_NEVER
BORDER_SIZEABLE
1-16
CHARTTYPE LINECHART2D PIECHART2D COLUMNCHART2D SCATTERCHART2D BARLINECHART2D CANDLE2D LINECHART3D PIECHART3D COLUMNCHART3D PERBARCHART3D STYLE DROPDOWN SIMPLE STYLE_3270 DROPDOWN SELECTIONTYPE SINGLE EXTENDED DRAWLINES NOLINES HLINES VLINES VHLINES MULTIPLE DROPDOWNLIST DROPDOWNLIST BARCHART2D STACKEDBARCHART2D SMOOTHLINECHART2D AREACHART2D HILOWCLOSE2D POINTANDFIG2D BARCHART3D STACKEDBARCHART3D AREACHART3D BARLINECHART3D
CoCtrl Object
GetAllAttributes()
Returns a Dictionary object containing a list of all the Attribute Objects for this control.
AddAttribute(String AttrbuteName)
Adds the specified attribute to the Panel object and returns the Attribute Object. This method is called when a new attribute that is not in the current Window Model needs to be added to the panel.
1-17
GetAttribute(String AttributeName)
Returns the Attribute Object for the specified attribute. Sample: pnl_read.vbs
GetType()
Returns the ControlType constant (defined above) that specifies this controls type Sample: pnl_read
DeleteAttribute(String AttributeName)
Deletes the specified attribute from this control. This can be done for attributes that are curently in the Window Model as well as new ones added by the user.
GetContents()
Returns a Dictionary Object containing the controls that are embedded in this control. Fails if no controls are present.
AddControl(ControlType type)
A control of ControlType type is added to this control. Sample: pnl_crt.vbs
DeleteControl(Control ctrl)
Deletes the Control specified by ctrl from this control.
DeleteContents()
Deletes all embedded controls in this control.
ChangeType()
Modifies the control type.
Copy()
Creates a SAFEARRAY of BYTEs that correspond to the panel file format for the control.
1-18
Attribute Object
set_Value(VARIANT val)
Sets the Value of this attribute to that specified by val. All variables in VBScript are of type VARIANT which is a generic type for all other supported types. This method would be successful as long as the value is of the right type, for example, String, Integer etc. Sample: pnl_crt.vbs
get_Value()
Returns the value of the attribute. If the attribute is a compound attribute, like Font or Color, then this value would contain an object like Font or Color. Sample: pnl_crt.vbs
get_Name()
Returns the name of this attribute Sample: pnl_read.vbs
DeleteAttribute()
Removes this attribute from the parent control.
1-19
How do I obtain a relation object between two objects? How do I create or modify files under a Component_Folder? Where do I look for Trace information about a TurboScripter session?
Note
The Freeway Service Manager module, gresvcnt.exe, must be running before you can connect to a personal repository via TurboScripter.
Note
The object and property names may differ from those in TurboCycler documentation. TurboScripter uses the exact names defined by the Workgroup repository.
1-20
1-21
Note
As of version 5.0 of VBScript and JScript, binary files are not supported. This restricts the use of TurboScripter to Text files.
1-22
CHAPTER
The TurboCycler product is a productivity tool that generates repository objects from other objects in the repository. The TurboCycler process improves productivity by automating repetitive tasks in the software development lifecycle. TurboCycler Standard Edition, when combined with the TurboCycler Developers Kit, provides an open architecture that lets you generate objects suitable to any development platform and methodology. This topic explains the TurboCycler generation process as it applies to the AppBuilder development environment and illustrates this process through the functions of the Standard Edition default templates. This section describes: Starting TurboCycler how to access TurboCycler from tools in the Construction Workbench Using Default Templates how to use the predefined templates provided with the product TurboCycler Tutorial how to use a sample application using TurboCycler To better understand the generation possibilities of TurboCycler, refer to Chapter 3, Using the TurboCycler Developer Kit.
Starting TurboCycler
When TurboCycler is installed, you can access it from the following application development tools: Database Diagrammer Entity Relationship Diagrammer Matrix Builder Process Dependency Diagrammer State Transition Diagrammer Window Flow Diagrammer Select New or Open and choose the development tool. When the tool window opens, select Analysis>TurboCycler. From Construction Workbench, select an object in the hierarchy and select Tools>TurboCycler.
2-1
Starting TurboCycler
Review the following sections for information about starting TurboCycler: Selecting Generation Templates Setting Up Generation Templates Generating Your Application
Note
Figure 2-1
3. 4.
The Selected Templates and Available Templates list boxes display templates you can use with the selected object type (in Figure 2-1, the object type is Function). Select the templates you want to use with the Add and Remove buttons.
Selecting a Template in TurboCycler
Figure 2-2
If you add additional templates, alter the default templates, or create new templates (using the TurboCycler Developers Kit), the objects you have created will be available through the query option. 5. Select Generate, Setup Templates, or Cancel. Generate starts the generation process. Setup Templates displays a window where you select the modules you want to generate (see Setting Up Generation Templates below). Cancel returns you to the previous window.
2-2
Starting TurboCycler
Figure 2-3
2.
The Object Type list box displays the repository object type and the Generation Templates list box lists templates for that object type (Figure 2-4). The text in the Template Description box describes the selected template. The Selected Modules and Available Modules list boxes identify the available modules for this object type/template combination. Select the modules you wish to generate with the Add and Remove buttons.
Generation Template Selection
Figure 2-4
2-3
Procedure - Generating the Application 1. 2. Select the Generate button in the Select Generation Templates window to start the TurboCycler process. The Rename Object window opens (Figure 2-5).
Rename Object Window
Figure 2-5
During the generation process, a status window notifies you of the generations progress. 3. Select the Cancel button to stop TurboCycler between modules. You can review the results of the TurboCycler process after completion.
The TurboCycler process generates objects using names defined by the templates for the objects you select. If you run TurboCycler more than once, previously generated objects with modifications are replaced by newly generated objects. Because of this, you must carefully examine the objects created by a generation. To validate the generation results and make sure that no desired user modifications have been lost, examine the hierarchy, rule, and window objects. If you are not pleased with the results of a generation process, you can roll back the session changes from the Construction Workbench.
Caution
2-4
output and make modifications easier. The default templates are designed for the single byte characters. For templates using 'String Manipulation function' in DBCS environment, you need to modify the default templates. CRUD Rules Template, includes SQL statements (Create, Read, Update, and Delete database access operations) GUI Rules/Windows Template, supplies graphical interface event-handling procedures Utilities Template, contains message-handling procedures used by generated objects Rename Views, Fields and Rules Template, modifies the source of any rules that refer to a renamed FIELD or VIEW object Rename Verify Template, shows the rules in the repository that need to be modified if the name of the selected object is changed Hierarchy Cloner Template, creates a new hierarchy of repository objects based on an existing hierarchy The TurboCycler process uses the default templates to create output objects with fully-coded rules including calls to system components as needed, painted windows with predefined styles, and view and field physical data structures. These objects are automatically related in a logical hierarchy in the repository.
Note
Two or more users should not run TurboCycler templates that create and update the same repository objects. This is true for objects that are sent through TurboCycler as well as other objects that the template may access to update or create. For example, the CRUD template uses common fields and views that are irrespective of the ERD on which it is applied. These fields and views are reused once they have been created. If two users run the CRUD template at the same time, the first user locks the common field and the other users cannot access it, leading to an error message Object exists in the repository in an Uncommitted State.
Using Default Templates describes how to use the default templates. It details the output objects the templates generate and defines the specific rules, windows, and hierarchies generated by each default template. The source code for each of these templates is included in the TurboCycler Developers Kit. Two source code samples are included in Template Samples on page 4-52 Using the default templates, you can generate a functional application, including complete function hierarchies, detail and list windows, database access rules, and standard utilities. You can write generation templates to automate an unlimited number of processes in the development lifecycle. You can also write templates to customize processes like forward engineering, transformation, reverse engineering, and any other process that generates objects in the repository from other repository objects.
2-5
Step 1 establishes the ERD as a logical model that consists of entities, relationships, properties, identifiers, and data types. In step 2, forward engineering creates a relational model containing tables, keys, and columns. Step 3 is the transformation to a structural model of files, views, and fields. These steps populate the repository with the information TurboCycler needs to generate a referencetable application. Without TurboCycler, developing applications using these objects requires you to write rules code yourself to reflect the model.
Encountering Errors
If TurboCycler encounters a repository error or other errors that are specific to an object, a message is displayed. If Error is encountered, TurboCycler will stop processing until the error is corrected.
2-6
Figure 2-6
2-7
2-8
menu provides undo and redo facilities. The Options menu lets you eliminate the status bar that appears at the top of the detail display. View or Query menu choices are available when the table implementing the entity contains referred-by keys (for the View menu) or foreign keys (for the Query menu). You can use View and Query menus to navigate from object to object (entity to entity) in the application. The status line, located under the menu bar, displays information about current actions.
2-9
Utilities Template
The Utilities template generates a message-handling rule and window for almost any modal message that a rule may need, such as an SQL failure. The only module included in this template is the Message Display Module.
2-10
Note
2-11
Caution
When cloning hierarchies containing error, lookup, or define sets, the encoding and display attribute values is replaced blindly without error checking for value overflow and such. It is your responsibility to ensure that these values do not overflow and are valid
If either of these conditions is not met, the object is reused and its child objects are not examined. If the object is to be cloned, cloner creates a new object of the same type with the cloned name and copies certain properties from the source object to the cloned object. The new object is attached to the new object hierarchy and cloning continues by examining children of the source object. If the cloned object already exists in the repository, it is reused and never modified. The properties copied are: Those that are available in TurboCycler Writable Not required to be unique by the repository Thus the template supplied is general purpose in nature and is not geared specifically to any one type of application hierarchy. If you have special requirements for cloning, customize the supplied template using the TurboCycler Developers Kit.
Note
Rollback does not remove all unwanted objects after cloning by TurboCycler.
2-12
The following objects can be cloned: FUNCTION PROCESS RULE FILE VIEW FIELD SET VALUE COMPONENT WINDOW In addition to these, the cloner will reuse BITMAP objects but it will not clone them. Because cloner never modifies existing objects in the repository, subsequent regeneration of this template has no effect. Component source will not be cloned.
Note
Always select a single object and choose TurboCycler Selected from the Analysis menu. Cloner automatically examines all objects under the selected one. Do not pass multiple objects for cloning.
When cloner executes, a dialog is displayed. The controls and their meanings are listed in Table 2-1.
Table 2-1 Control Replace (entry field) With (entry field) Add (push-button) Delete (push-button) Move Up (push-button) Move Down (push-button) Objects to clone (listbox) Objects to reuse (listbox) Clone (push-button) Cloner Controls and Descriptions Description The substring to search for The replacement string to use Add the new pair of strings to the list Delete the selected pair of strings from the list Move the selected pair of strings up in the list Move the selected pair of strings down in the list Objects listed here are candidates for cloning Objects listed here will never be cloned Begins the cloning process
When cloner is finished, the new hierarchy is displayed. In this display, you can browse the new hierarchy and see the objects that were created.
2-13
TurboCycler Tutorial
The REPLACE entry contains a series of substrings to search for, separated by spaces. The WITH entry contains one replacement string for each substring in the REPLACE entry. TEXT_AND_KEYWORDS may be set to: IGNORE, indicating that created objects have no text or keywords COPY, indicating that created objects have the same text and keywords as the source object CLONE, indicating that created objects have the same text and keywords as the source object except modified by the name cloning procedure If SOURCE_FILES is NO then created objects have identical source files as the source object; if it is YES then source files are cloned. The REUSE entry contains a list of object types separated by a single space that are never to be cloned, regardless of their names. The IMPLEMENTATION_NAMES entry may be either YES or NO depending on whether implementation names and screen literals should be cloned. When cloner forms a name that is too long, it either automatically truncates the name or displays a dialog asking the user to provide a shorter name. This choice is controlled by the TRUNCATE_LONG_NAMES entry which may be either YES or NO. Typically, you do not need to look at this file since if you select Cloner and Generate, a dialog box displays and this window setting is written to TURBO.INI.
TurboCycler Tutorial
TurboCycler software complements and enhances the AppBuilder environment. Because of their compatibilities, the sample TurboCycler tutorial is an extension of the AppBuilder environment walkthroughs in the workstation Workbench reference. The tutorials summarize the automobile rental agency sample from AppBuilder training and show the results when you use the TurboCycler product with the same repository objects. The tutorial that follows assumes that you perform all of the steps for each tool. The steps are: Reviewing Forward Engineering and Transforming Generating with TurboCycler
2-14
TurboCycler Tutorial
Figure 2-8
2. 3. 4.
Choose Select All in the Edit menu, then choose Open as/Hierarchy in the Edit menu to open a constrained version of the hierarchy. Create the attributes, identifiers, and data types for the AGENT entity. As you create each data type, double-click its name to display the Edit Type window. Choose the data format corresponding to the data types name from the list box and then change the data length field if necessary. Create the hierarchies for the RESERVATION and VEHICLE entities shown in Figure 2-9.
RESERVATION and VEHICLE entity hierarchies
5.
Figure 2-9
6.
Create the hierarchies for the CUSTOMER and LOCATION entities shown in Figure 2-10.
2-15
TurboCycler Tutorial
Figure 2-10
7.
Create the hierarchies for the CORPORATE and INDIVIDUAL entities shown in Figure 2-11.
CORPORATE and INDIVIDUAL entity hierarchies
Figure 2-11
8.
Open the Construction Workbench window and select Commit Sessions changes in the Session menu. Name the entity relationship drawing RENTAL_ERD.
Note
4. 5.
Choose Forward engineer in the Analysis menu. This process should complete without error. Repeat the previous steps if you have errors. Create a new Database Diagram to view the created tables.
2-16
TurboCycler Tutorial
Figure 2-12
6.
Select File > Commit, or Ctrl+M or click on the Commit icon. If you have displayed the columns and keys in the Database Diagrammer, name and save the drawing.
Transforming a DBD
This section assumes you have created the ERD and attributes in an entity relationship diagram as described in Defining an Entity Relationship Diagram on page 2-15, and that you forward engineered as described in Forward Engineering an Entity Relationship Diagram on page 2-16. 1. 2. 3. 4. 5. Select File > New > Database Diagram to create a new database diagram. Select Insert > Table and query the following: AGENT, RESERVATION, VEHICLE, RESERVES, LOCATION, INDIVIDUAL, CORPORATE, CUSTOMER. . Select Transform in the Analysis menu. Right-click in the hierarchy to query the file entities created. Select Hierarchy in the Objects menu.
2-17
TurboCycler Tutorial
1.
Go through the fields of the data views of your files in Hierarchy Diagram. Review each field, and double-click its name to display the Properties Field window. Look to see the system-generated name in the Screen literallong field. Edit each literal as necessary to change it permanently. Select File > Commit to save session changes.
2.
3.
2-18
TurboCycler Tutorial
Figure 2-14
This displays the TurboCyclerGeneration Template Setup window, which lists the modules available for each object type shown. 4. 5. Select Entity in the Object Type list box and CRUD Rules in the Generation Template list box. Then select modules for generation using the Add and Remove buttons. Check all generation templates to make sure you select all the available modules for every template.
TurboCyclerGeneration Template Setup window
Figure 2-15
6.
Select Close. If you have selected the appropriate entity templates and the modules that support it, select the Generate button to start generation. The message line shows the status of the process. If there are errors, repeat the process. Select File > Commit to save changes.
7.
2-19
TurboCycler Tutorial
b. Select Generated Sets: prepare sets c. Select Generated Windows: prepare windows d. Select Generated Rules: prepare rules e. Select Generated Functions: prepare functions These steps are performed in the Preparation Query window, discussed in the Deploying Applications Guide in the chapter on Preparation. 2. At each preparation step, you may encounter errors. It is important to correct errors using the appropriate application development tools before continuing with succeeding steps.
At this point, the preparation of the generated application is complete. Next, run the application (as described in Procedure - Executing the Application) to examine and test the output application, including the windows you prepared and painted in TurboCycler. Procedure - Executing the Application Follow the steps listed below to test the application TurboCycler generated. 1. 1. 2. Select Start > Programs > AppBuilder > Windows Client. To execute from within the Construction Workbench, select Run > Windows. Select Agent Maintenance in the Agent menu.
AGENT MAINTENANCE application menu
Figure 2-16
3. 4.
The Execution Workbench asks if you want to start RuleView. Select No. The Agent Detail Display window is displayed without any data as shown in Figure 2-17.
Agent Detail Display window without data
Figure 2-17
5. 6.
Enter test data in the following fields. Enter the Agent number, Agent last name, and Agent first name (Figure 2-18). Save this agent data by selecting Save in the File menu.
Agent Detail Display window with user data
Figure 2-18
2-20
TurboCycler Tutorial
7. 8.
Enter any name (for example, your own name) as additional test data in the Agent Detail Display window. Be sure to assign a different agent number. Save this data as you did in the previous step. Select Open in the File menu to see the Agent List Display window. Next select the Query push button to display both agents, as shown in Figure 2-19.
Agent List Display with user data
Figure 2-19
9.
Select Query and verify that both agent Smith and the other persons name appear in the Agent List Display window. (You can either query individual agents by their unique number or select the Query push button to see a list of all agents.)
10. To view the Agent Detail window for any agent, double-click the agents name. When you close the Agent Detail window, you return to the Agent Detail Display window. 11. Conclude this walkthrough by selecting Exit in the File menu.
2-21
TurboCycler Tutorial
2-22
CHAPTER
The TurboCycler Developer Kit (SDK) provides an open architecture for automatically generating repository objects suitable for any platform and methodology. TurboCycler Developer Kit is a complementary product to the TurboCycler Standard Edition. With the Developer Kit, you define generation procedures using templates to automate steps in the software development lifecycle. You can write these generation procedures to meet your requirements. To customize the template using the TurboCycler Developers Kit follow these general procedures: Creating a Generation Template Editing and Compiling a Template
3-1
A generation template can define object hierarchies, rules source code, and window panels, as shown in Figure 3-1. You can generate a completely functional application by using these templates in the AppBuilder environment.
Figure 3-1 Functionality of Generation Templates
Rule
*>------------------------------------------------<* *>- Rule: PRODUCT_SQL_DELETE -<* *>- SQL Delete Rule for the File: PRODUCT. -<* *>- Automatically Generated by AppBuilder*TurboCycler. -<* *>------------------------------------------------<* SQL ASIS DELETE FROM PRODUCT When building an object hierarchy, the generation template generates both the repository objects and the relationships between them, and sets their properties. Templates can generate any type of object hierarchy including AppBuilder file, rule, and window hierarchies. When defining rule source code, the generation template completely defines an AppBuilder rule. The source code associated with the rule can include any statement the AppBuilder environment supports and can conform to your indentation and naming standards. Window panels generated from a template can contain any type of control that the AppBuilder Window Painter supports. The template defines the position of the controls in the window and associates them with objects in the repository. Chapter 6, TurboCycler Window Controls discusses the types of controls for window panels and their properties.
3-2
If you change an existing template, you can change its object-naming standards, rules coding style and functionality, window presentation styles, and nearly anything else you want. Default templates packaged with TurboCycler are not read-only or otherwise protected. It is prudent to copy them before editing them. Also remember to compile the template before executing it.
where: <source> = template source file name without the .SRC extension. You specify only the file name because the .SRC file extension is assumed. All other functions described in the following sections are available only through the template manager.
3-3
Figure 3-2
The main window for the template compiler contains a title bar identifying the template manager window, a menu bar, a tool bar, and a work area with template information.
3-4
Table 3-1 describes the Actions menu choices. Note that each Actions menu choice effects all listed templates, not just those currently selected.
Table 3-1 Actions Actions Menu Choices Description Displays the New Template window (Figure 3-4) that helps you prepare a new skeleton or outline template. You can define the file name, template title, and description; create hierarchy, rule, window, text, keywords, flat file, and/or component sections; and edit the template. You can also select this choice from the tool bar with the New push button. Compiles every template source file whose Last write time is later than its Last compile time. You can also select this choice from the tool bar with the Make push button. Clears the list of templates shown and rereads the template source directory. You can also select this choice from the tool bar with the Rescan push button. Removes any templates waiting for compilation from the compile queue. Compiling stops when the current template completes. You can also select this choice from the tool bar with the Stop push button. Exits the template manager. New Template window
New Template
Make
Selected Menu The menu bar contains a Selected menu, as shown in Figure 3-5.
3-5
Figure 3-5
Table 3-2 describes the Selected menu items and descriptions. These menu choices effect only the selected templates.
Table 3-2 Menu Item Edit source Selected Menu Choices Description Opens the editor for the selected templates. (Depending on options set in the Set Editor window, you can open the editor once for each selected template or once for all selected templates.) You can also select this choice from the tool bar with the Edit push button. Queues the selected templates and compiles them in the order they appear in the window. You can also select this choice from the tool bar with the Compile push button. Opens the Copy Template window (Figure 3-6), which lets you copy each of the selected templates and give the copy a name and title. You can also select this choice from the tool bar with the Copy push button. Deletes the source and compiled files for all selected templates. You can also select this choice from the tool bar with the Delete push button. Rescans the source files of the selected templates to check whether the title or last-written times have changed. (Use this when you use the editor to make changes to a template.) You can also select this choice from the tool bar with the Update push button.
Compile source
Copy source
Update display
Figure 3-6
3-6
Windows Menu The menu bar contains a Windows menu, as shown in Figure 3-7.
Figure 3-7 Template Manager Windows Menu
Options Menu The menu bar contains an Options menu, shown in Figure 3-8.
Figure 3-8 Template Manager Options Menu
Table 3-4 describes the Options menu choices and describes their behaviors.
Table 3-4 Options Menu Description Displays the Open Template Directory window (Figure 3-9) that specifies the directory where templates reside on the developers system. Specifies the action to be performed when you double-click on a template or press Enter. Your choices are Edit, Compile, Copy, Delete, or Update display. Opens the Set Editor window (Figure 3-10) in which you can specify your editor. The editor command field defines the executable path name, and the editor command line field specifies the command line arguments to pass to the editor. If your editor supports passing multiple file names on the command line, use the %a specifier. Otherwise, use the %f specifier to open the editor separately for each selected template. You can also specify any other options to pass to the editor. Menu Items Template directory Default action
Editor
3-7
Figure 3-9
Figure 3-10
View Menu The View menu lets you choose whether to display the toolbar and the status bar while you are working in the template compiler window. To display either bar, click on the name of the bar in the drop-down list. A check mark appears. To hide either bar, click again to remove the check mark. Tool Bar For fast access to the Actions and Selected menu choices, use the tool bar at the bottom of the template manager window (Figure 3-11).
Figure 3-11 Template Manager Tool Bar
3-8
The Tool Bar presents the menu choices as push buttons (Table 3-5).
Table 3-5 Icon Tool Bar Push Buttons Push button Menu choice equivalent
Edit
Compile
Make
Stop
Copy
New
Delete
Update
Rescan
Compiled
3-9
Table 3-6
Dialog columns
Queued for compilation Template title Filename Last write date Last write time Last compile date Last compile time The assigned title of the template. The file name of the template as stored in the designated directory. (Preassigned file extensions are .SRC for a source template and .TC for a compiled template.) The date of the last template writing. The time of the last template writing. The date of the last successful template compilation. The time of the last successful template compilation.
3-10
CHAPTER
The TurboCycler Developers Kit provides an open architecture for automatically generating repository objects suitable for any platform and methodology. TurboCycler Developers Kit is a complementary product to the TurboCycler Standard Edition. With the Developers Kit, you define generation procedures using templates to automate steps in the software development lifecycle. You can write these generation procedures to meet your standards requirements and methodology needs. The TurboCycler template language defines how to generate repository objects from other repository objects. The logic of a template can include standard language statements (such as IFELSE and WHILE) and more specific TurboCycler statements. TurboCycler statements support repository navigation, queries, and generation. This section presents the important high-level concepts for developing templates, followed by the rudimentary statements. If you are not familiar with basic programming techniques, you may need to review those sections in the supporting statements and structures section before learning the template sections and concepts. You can find detailed information on language usage, syntax, and function of the AppBuilder Rules Language in the Rules Language Reference book.
Caution
Flow diagrams may not illustrate every condition and restriction of each statement. Read the description of each statement for complete information.
4-1
Reading a Diagram
Follow these steps to understand the syntax of a diagram: 1. 2. Start at the double-headed arrow on the left side and go to the end of the diagram. Follow any one of the possible line paths from left to right. Any path that you can traverse from left to right results in valid syntax. In whichever line you follow, you must use all words or symbols that you move through on that line. You cannot go back to the left unless there is a loop, which is indicated by an arrow on its left end and appears above another line. You can go around a loop any number of times.
3.
Statement Sample This sample shows a simple flow diagram. It illustrates the basic approach that the TurboCycler flows follow:
comment_statement declarative_statement assignment_statement flow_of_control_statement transfer_of_control_statement file_access_statement asynchronous_processing_statement
4-2
Both the // token and the new line are discarded from the input. For example: USE FIELD(x) // Get the name of the field SET Y = QUERY NAME OF X ENDUSE
TEMPLATE Statement
The TEMPLATE statement is the starting point of a TurboCycler template. It provides the template with a title and description, by which the user identifies the template during the TurboCycler Standard Editions generation process. A template contains only one TEMPLATE statement and has a unique name. A template also contains a usages block that determines the initiation process for this template. A template can contain multiple hierarchy, rule, and window blocks grouped in modules by a common module name. template_name A string constant that identifies this template. This is the title of the template the user sees during a TurboCycler Standard Edition generation. For example, the CRUD Rules default template is named CRUD Rules. DESCRIPTIONENDDESCRIPTION Keywords that surround the template description.
4-3
template_description A string constant that describes this template. This is the only description for a template the user sees during a TurboCycler generation. For example, the default template named CRUD Rules has the description Generates the CRUD Rules for the specified Entity, Table or File object. The description can be as short or long as you want; it may include multiple lines. usages_block A template language statement that provides the entry point that TurboCycler uses to run the template. In most cases TurboCycler starts with a single repository object and proceeds to extract information about that object needed to generate hierarchies, rules, or windows. Entry points for the default templates are entity, a many-to-many relationship, table, and file. A usages block takes a single object and performs assorted repository queries. It sets up variables that other blocks depend on. Refer to USAGES Block on page 4-5 for details. hierarchy_block A template language statement that defines a hierarchy for any object type, such as rule hierarchy, window hierarchy, file hierarchy, and other hierarchies. The hierarchy block creates objects, sets their properties, creates relationships between objects, and sets properties for the relationships. Refer to HIERARCHY Block on page 4-6 for details. rule_block A template language statement that defines the source code (or rules source) for a specific rule. For example, the SQL Delete Rule in the CRUD Rules Template. Refer to RULE Block on page 4-9 for details. window_block A template language statement that paints a window panel for a specific window; for example, the Detail Display Window in the GUI Rules/Window Template. The window block places controls on the window and establishes links to appropriate repository objects. Refer to WINDOW Block on page 4-12 for details.
Special Notes
Different blocks can be strongly dependent on each other. For example, generated rule source depends on a rule hierarchy. You can force multiple blocks to be generated by giving them all the same module name, thus reinforcing their dependence. Another example of block interdependence is a rule conversing a window. To use a template to generate a rule conversing a window requires four heavily dependent blocks: Rule source block Window panel block Rule hierarchy block Window hierarchy block Reinforce this dependence by giving all the same module name. Figure 4-1 shows this relationship.
4-4
Figure 4-1
The Detail Display Module is composed of: Detail Display Module (1) (3) (2) (4) where: (1) = Rules source block (2) = Window panel block (3) = Rule hierarchy block (4) = Window hierarchy block
The Detail Display Module illustrated graphically: (1) RULE converses (2) WINDOW
uses (3)
uses (4)
RULE
WINDOW
USAGES Block
The usages block accepts specified repository object types as valid entry points into the generation process that the template describes. It associates the current template with repository object(s) of the object types you specify. Control which objects are selected for generation with the USAGES statement. TurboCycler generates output objects only for the object types you specify in the usages block.
USAGES USE object_type (object_var) USE ALL use_statement: // common_statement // use_statement use_statement ENDUSE ENDUSE
ENDUSAGES
Thus, your selection influences the tools from which you can access this template. For example, if you define a template to accept entities as input, the template is available from only those tools supporting entities (such as Entity Relationship Diagrammer, Hierarchy Diagrammer, and Matrix Builder).
4-5
USAGESENDUSAGES Keywords that surround the usages block. USEENDUSE Keywords that surround your specification of a valid object type, object variable, and use_statement. Each USEENDUSE set supports only one object_type specification. Repeat this set of keywords for each object type you want the template to support. object_type The object type you want this template to support generation from. Any object type in the Information Model is valid, such as RULE, WINDOW, VIEW, or FIELD. You can select more than one object type by using multiple USEENDUSE repetitions, as shown in the flow diagram. Refer to Object Types and Properties on page 5-3 for a list of object types. The object type can also be an open drawing. The USE type supports processing the symbols on an open drawing through a template. Refer to Processing Symbols on an Open Drawing on page 4-45 for details. (object_var) An object variable that stores a reference to the repository object passed into the template from a AppBuilder development tool. use_statement A sequence of statements that are part of the usages block. These statements insert the common statement services of use-dependent queries and variable initializations such as RETURN, DEBUG, IF, FOR, WHILE, and SET. See common_statement below. USE ALLENDUSE Keywords that surround your specification of all shared use statements in a usages block. The use statements contained in the USE ALLENDUSE set are applied to each USEENDUSE set. USE ALLENDUSE allows you to code any function that you want applied to all USEENDUSE invocations only once. The generation process then executes the complete set for each USEENDUSE set defined in the usages block. common_statement A sequence of statements common to several block statements including this one. The common statement provides common services for use-dependent queries and variable initializations such as RETURN, DEBUG, IF, FOR, WHILE, and SET. Refer to Common Statement on page 4-29 for details.
HIERARCHY Block
The hierarchy block defines a hierarchy for any object type such as a rule hierarchy, window hierarchy, or file hierarchy. The hierarchy block creates objects and sets properties for them, creates relationships between objects, and sets properties for those relationships.
4-6
HIERARCHY
module_name
hierarchy_statement ENDHIERARCHY
, object_property_expr ] , //
->
object_type object_name
object_property_expr ] ,
[ relation_property_expr ]
The hierarchy block that TurboCycler generates closely resembles the hierarchy AppBuilder Hierarchy prepares in both content and form because both: Create repository objects Set properties for those objects Create relationships between objects Set properties of the relationships
4-7
Figure 4-2
RULE(1) ABC (4) (3) (3) (4) (3) (4) VIEW (3) (4) FLD FLD (1) (1) (1) ABC_F1 (2) ABC_F2 (2) VIEW (1) ABC_IV
(1) Create object (2) Set property (3) Create relationship (4) Set properties of relations
FLD
-> RULE "ABC" -> -> VIEW "ABC_IV" VIA RELATION OWNS_VIEW [SEQUENCE=10, USAGE="INPUT"] -> -> -> FIELD "ABC_F1" [TYPE="INTEGER", LENGTH=15] VIA RELATION VIEW_INCLUDES [SEQUENCE=10] -> -> -> FIELD "ABC_F2" [TYPE="INTEGER", LENGTH=15] HIERARCHYENDHIERARCHY Keywords that surround the hierarchy block. module_name A string constant that provides the name for the module to be generated. The name must be a unique phrase that accurately distinguishes this module from any other. The user of a template selects the module for generation using the TurboCycler Setup Generation Templates window. hierarchy_statement A sequence of statements that are part of the hierarchy block. These statements insert the unique hierarchical statements for creating entities and templates. The hierarchy_statement also inserts the common statement services of hierarchy-dependent queries and variable initializations such as RETURN, DEBUG, IF, FOR, WHILE, and SET. Refer to common_statement on page 4-9. -> A hierarchy symbol that establishes the generational level for the following definition of an object. object_type A parameter that defines the type of object being generated. Refer to Object Types and Properties on page 5-3 for a list of object types.
4-8
object_name Either a string expression or an object expression that specifies the name of the object being generated. [] A set of brackets that encloses properties of the object that are to be set. , A punctuation mark (comma) that separates each property being set. Use a comma to separate each object property expression (see object_property_expr below). object_property_expr An object property expression that sets the property of the object to the specified value. Refer to Object Types and Properties on page 5-3 for a detailed list. The format for this statement is PROPERTY = string_expr or PROPERTY = int_expr. VIA RELATION A keyword that creates the relationship for the object and specifies how the child object is to be related to the parent object. relation_type A parameter that defines the type of relationship for the object. Refer to Relationship Types and Properties on page 5-12 for a detailed list. relation_property_expr A parameter that sets the properties of the relationship to the specified value. Refer to Relationship Types and Properties on page 5-12 for a detailed list. The format for this statement is PROPERTY = string_expr or PROPERTY = int_expr. common_statement A sequence of statements common to several block statements including this one. The common statement provides common services for hierarchy-dependent queries and variable initializations such as RETURN, DEBUG, IF, FOR, WHILE, and SET. Refer to Common Statement on page 4-29 for details.
RULE Block
The rule block defines the rules source code for a specific rule. An example of a rule block is the SQL Delete Rule in the CRUD Rules Template. Note that if the repository already has existing source code for a specified rule, any code you generate with an identical name overwrites the existing code.
4-9
RULE
module_name
NAMED
rule_name
rule_statement
ENDRULE
The rule block creates rule source code as well as all common template statements for manipulating variables, looping and branching, returns, and debugging. You can recognize rule source by the curly braces that enclose it. Everything you write within the curly braces goes into the rule code, either directly as rule source code or indirectly by macro substitution. RULEENDRULE Keywords that surround the rule block. module_name A string constant that provides the name for the module to be generated. The name must be a unique phrase that accurately distinguishes this module from any other. The user of a template selects the module for generation using the TurboCycler Setup Generation Templates window. NAMED Keyword that specifies the rule that the rule_name parameter identifies. rule_name Either a string expression or object expression that identifies the rule to be generated in the repository. rule_statement A sequence of statements that are part of the rule block. These statements include the unique curly braces rules code and the common statement services of rule-dependent queries and variable initializations such as RETURN, DEBUG, IF, FOR, WHILE, and SET. Refer to common_statement below. {} Curly brace symbols indicate that the enclosed statements are rules code. Rules code can be a single statement or multiple statements. The source of rules code is either direct as a copy from the template (see rule_source below) or indirect from a substitution macro (see $(substitution_macro) below). rule_source Everything that is enclosed in braces, except the $(substitution_macro) format, is put directly into rules code. Code the Rules Language statement you want incorporated. See Special Notes below for more information.
4-10
$(substitution_macro) Everything that is enclosed in the $() format becomes rules source code by macro substitution. Use this statement to place the value of template variables or expressions into the rules source. See Special Notes below for more information. common_statement A sequence of statements common to several block statements including this one. The common statement provides common services for rule-dependent queries and variable initializations such as RETURN, DEBUG, IF, FOR, WHILE, and SET. Refer to Common Statement on page 4-29.
Special Notes
The RULE and NAMED keywords identify the name of the module for the TurboCycler user and rule object to be added to the repository. For example, the statement: RULE SAMPLE NAMED B creates a module called SAMPLE, which generates rules source code for object B in the repository. If source code exists for object B, the new rule source overwrites the existing code. The AppBuilder environment does not allow more than 72 characters per line of rules source. If a template has more characters per line, TurboCycler breaks each line at the last blank space before the seventy-second character limit, making as many lines as needed. Create rules source code by coding inside the curly braces, including any macro substitutions. The position of curly braces determines the indentation of the rules source code. An example is provided below. (Refer to Template Samples on page 4-52 for a detailed sample of a real rule source generation). RULE Sample NAMED B SET V = GET VIEW NAMED V1 { *> Rule generated by TurboCycler <*) } SET FROM = 10 { DCL I INTEGER; ENDCL MAP $(FROM) TO I MAP $(FROM + 20) TO RETURN_CODE OF $(QUERY NAME OF V) } ENDRULE TurboCycler generates the following rules source code: *> Rule generated by TurboCycler <* DCL I INTEGER; ENDCL MAP 10 TO I MAP 30 TO RETURN_CODE OF V1
4-11
WINDOW Block
The window block paints a window panel for a specific window, such as the Detail Display Window in the GUI Rules/Window Template. The window block places controls on the window and links them to appropriate repository objects.
WINDOW module_name NAMED PLATFORM window_object
window_platform
window_statement window_statement:
ENDWINDOW ,
//
menu_property
] ,
//
MAKE
control_var link_object
HAVING [ OF
control_property_expr link_qualifier
ENDMAKE
CONTAIN
control_type
control_var
IN
parent_control , control_property_expr ]
HAVING [
LINKED TO
link_object
OF
link_qualifier
ENDCONTAIN
SIZE WINDOW
window_width left_corner
BY ,
window_height bottom_corner
4-12
Building menus in a window is similar to making menu hierarchies with Window Painters menu editor. The statements in a window block specify window panels in a way that corresponds to the Window Painters graphic interface. For example, the window block MAKE statement corresponds to dropping controls in Window Painter. However, TurboCycler does not support creating or updating cascading menus from the template. The PLATFORM keyword and its parameter window_platform specify the GUI target of the window. This expression translates to a GUI domain value, defined in Property Domains on page 5-23. The default value is PWS_GENERIC. This lets you create 3270 or other types of window panels, but you must observe documented AppBuilder restrictions on those panels. The following example shows how to code a window block statement that constructs a menu. The example creates a menu for the File item, consisting of lines for New, Save, and Exit, each of which has a separator between them. REM --- Generate a sample window ---; WINDOW Sample Window NAMED MyDetailSample SET MyCDV = GET VIEW NAMED MyClonedDataView REM --- Make the Detail Sample Display ---; -> MENUITEM &File -> -> MENUITEM &New [HPSID=New] -> -> SEPARATOR -> -> MENUITEM &Save [HPSID=Save,GREYED=TRUE] -> -> SEPARATOR -> -> MENUITEM &Exit [HPSID=Exit] ENDWINDOW See Template Samples on page 4-52 for detailed coding of template windows. WINDOWENDWINDOW Keywords that surround the window block. module_name A string constant that provides the name for the module to be generated. The name must be a unique phrase that accurately distinguishes this module from any other. The user of a template selects the module for generation using the TurboCycler Setup Generation Templates window. NAMED Keyword that specifies the window that the window_name parameter identifies. window_name Either a string expression or object expression that names the window to be generated in the repository. window_statement A sequence of statements that are part of the window block. These statements include the window block-specific statements as well as the common statement services of window-dependent queries and variable initializations such as RETURN, DEBUG, IF, FOR, WHILE, and SET .Refer to common_statement on page 4-16.
4-13
-> A menu hierarchy symbol that establishes the generational level for the menu item entry. MENUITEM A keyword that starts the text for a menu line and assigns its properties. menu_text The menu text (a string expression) that provides the text of a menu line. [] A set of brackets that enclose properties of the menu item to be set. menu_property Menu property sets the properties associated with a menu item. Refer to the following flow diagram for this variables parameters.
HPSID GREYED = = = string_expr TRUE FALSE
CHECK_MANDATORY_FIELDS CHECKED =
SEPARATOR A keyword that creates a horizontal divider in a list of menu lines. MAKEENDMAKE A set of keywords that makes a control on the window. You can also define the controls properties and link it to a repository object in the MAKE ENDMAKE statement. control_type A parameter that describes the kind of window control being generated. Refer to Window Statement Control Types on page 6-2 for details of control types. control_var A control variable that stores a reference to a window control and gives access to the control later; essentially it names the object being created by the MAKE. Use it with functions like LEFTOF or BOTTOMOF. HAVING A keyword that sets the properties for the window controls. Each control type has its own properties defined by the parameter following control_property_expr. control_property_expr A parameter that defines the properties for the window control. Refer to Window Control Properties on page 6-12 for the detailed parameter list of the properties of window controls. The format of this expression is PROPERTY = string or PROPERTY = integer.
4-14
LINKED TO A keyword that connects the control being created to an existing repository object. You can link controls only to objects that are descendents of a window view. link_object An object expression that names the repository object associated with the made control object being created. OF A keyword required when the link to a control is a descendent that is not a direct child of the window view. Each level needed to link to a direct child of the window view requires an OF keyword. Use the OF statement multiple times to link to the appropriate level of the window view. link_qualifier An object expression that identifies the descendent of the window view for which the link is being made. CONTAINENDCONTAIN A set of keywords that, like the MAKEENDMAKE keywords, also define the type, name, and properties of a window control object. The CONTAIN statement makes a window control within a previously defined control. Use CONTAIN to make CELLS in a SPREADSHEET or to define the axes of a CHART. The format of these parameters is the same as the MAKE keywords. IN A keyword that identifies the parent control of the contained control. parent_control A control variable that names the parent control object of the contained control being defined. SIZE WINDOW A keyword that defines the dimensions of the window being generated. window_width An integer expression giving the width of the window in pixels. BY A keyword that indicates another window dimension follows. window_height An integer expression giving the height of the window in pixels. POSITION WINDOW A keyword that defines the location of the window being generated. left_corner An integer expression that locates the left side of the window being generated.
4-15
Other Blocks
bottom_corner An integer expression that locates the bottom of the window being generated. common_statement A sequence of statements common to several block statements including this one. The common statement provides common services for window-dependent queries and variable initializations such as RETURN, DEBUG, IF, FOR, WHILE, and SET. Refer to Common Statement on page 4-29 for details.
Other Blocks
These include: COMPONENT Block FLATFILE Block KEYWORDS Block TEXT Block USE ANY Block DIALOG Block See also the Supporting Statements and Expressions.
COMPONENT Block
This block is available for composing the source of a COMPONENT. Its syntax is:
COMPONENT module_name NAMED component_name
rule_statement
ENDCOMPONENT
The statements supported are the same as for the RULE block statement. For details, refer to the RULE Block on page 4-9.
FLATFILE Block
This block is available for composing text files. Its syntax is:
FLATFILE module_name NAMED file_name ENDFLATFILE
The statements allowed are the same as for the RULE block statement. For details, refer to the RULE Block on page 4-9.
4-16
Other Blocks
KEYWORDS Block
This block is available for composing the KEYWORDS of an object. Its syntax is:
KEYWORDS module_name NAMED object_expr
ENDKEYWORDS
The object_expr translates to the repository object for which the KEYWORDS are to be written. The statements allowed are the same as for the RULE block statement. For details, refer to the RULE Block on page 4-9.
TEXT Block
A new block is available for composing the TEXT of an object. Its syntax is:
TEXT module_name NAMED object_expr ENDTEXT
The object_expr translates to the repository object you are writing the TEXT for. The statements allowed are the same as for the RULE block statement. For details, refer to the RULE Block on page 4-9.
If you use the USE ANYENDUSE block, put it after all your USEENDUSE blocks and before the USE ALLENDUSE block.
DIALOG Block
A block type is available for composing user dialogs. The block is: DIALOG module_name // Dialog statements ENDDIALOG The DIALOG block lets you prepare and display a dialog box to the user while the template is running. This can be used to ask questions of the user and to display the results of the generation process.
4-17
Other Blocks
It is important to note that the origin that you use as the starting point for your coordinates is different in OS/2 and Windows. For OS/2, the origin is bottom and left. For Windows, the origin is top and left.
4-18
Other Blocks
N N N N x N N N
x x x x x x x x
x x x x x x x x x
x x x x x x x x
x x x x x x x x x x N
x x x x x x x x
x x x x x x x x x x x x x
x x x x x x x x N x
x x x x x x x x x
Dialog Control Property Descriptions Type boolean boolean integer string boolean boolean integer boolean integer integer boolean boolean boolean boolean boolean boolean integer boolean Description Control scrolls right automatically. Also scrolls down for Multiline Edit. Gives the control a border. Sets the vertical position of the bottom edge of the control. Text displayed by the control. Button has heavy emphasis. Used primarily to group radio buttons. Sets the vertical size of the control. Control has a horizontal scroll bar. Allows the template to recognize the control. Sets the position of the control. Gives the control a border. Multiple items can be selected. Text is invisible. Text cannot be altered. User can tab to the control. Control has a vertical scroll bar. Sets the horizontal width of the control. Text automatically wraps.
AUTOSCROLL BORDER BOTTOM CONTROL_TEXT DEFAULT GROUPSTART HEIGHT HORZSCROLL HPSID LEFT MARGIN MULTIPLE_SELECTION PASSWORD READONLY TABSTOP VERTSCROLL WIDTH WORDWRAP
4-19
Other Blocks
Using Linked-to Variables The control types listed below can have a linked-to clause. The linked-to clause is always optional. Unlike the WINDOW block MAKE statement, the linked-to clause must always specify a template variable. CHECKBOX The button is checked if the linked variable contains the value TRUE, otherwise it is unchecked. After the dialog is closed, the variable contains either the value TRUE or FALSE, depending on whether the user checked or unchecked the button. RADIO_BUTTON The button is checked if the linked variable contains the HPSID of the RADIO_BUTTON. After the dialog is closed, the variable contains the HPSID of the button only if it is checked. Normally you will link several, mutually exclusive RADIO_BUTTONS to a single variable. Then, the variable will contain the HPSID of the RADIO_BUTTON selected by the user before closing the dialog. EDIT_FIELD The text displayed in the EDIT_FIELD is taken from the linked variable. After the dialog is closed, the linked variable contains the user-modified text. MULTILINE_EDIT The text displayed in the MULTILINE_EDIT is taken from the linked variable. After the dialog is closed, the linked variable contains the user-modified text. LISTBOX The linked variable must be list. The LISTBOX is populated using the items of the list variable. When the dialog is closed, the variable is modified to contain a list of the selected items from the LISTBOX.
Note
If the LINKED_TO variable has not been assigned a value, it will default to the LOCAL variable.
Using the TCDIALOG Variable to Set the Properties of the Dialog Window
As in the window block, TurboCycler creates a local variable named TCDIALOG upon entry into a dialog block. This variable represents the dialog window itself, and the following properties can be set using this variable: LEFT, for setting the left edge of the dialog BOTTOM, for setting the bottom edge of the dialog TOP, for setting the top edge of the dialog WIDTH, for setting the width of the dialog HEIGHT, for setting the height of the dialog CONTROL_TEXT, for setting the caption displayed on the dialogs title bar
4-20
Note
In NT, if you press the Esc key, the TCEVENTSOURCE variable is assigned the value of IDCANCEL.
4-21
Procedures are not part of any module, and they will only execute when called from elsewhere in the template. Use a CALL statement to call a procedure: CALL PROCEDURE Test // or... SET PROC = Test CALL PROCEDURE PROC Arguments can also be passed. The procedure declares formal parameters as follows: PROCEDURE REQUIRES [X, Y, Z] HIERARCHY Test // statements ENDHIERARCHY The parameters become local variables to the block and can be referenced immediately, even in the block header: PROCEDURE REQUIRES [ARULE, AVIEW] HIERARCHY Test1 USES LOCAL [X = QUERY NAME OF ARULE] // statements ENDHIERARCHY PROCEDURE REQUIRES [RULENAME] RULE Test2 NAMED RULENAME // statements ENDRULE The CALL statement passes actual arguments: CALL PROCEDURE Test1 PASSING [MYRULE, MYVIEW] Currently, arguments are passed by reference only, so only currently defined variables can be passed as arguments. If the procedure alters the value of a parameter, the value of the corresponding argument is also altered. Do not give two different procedures the same nameonly the first will be recognized as there is no module concept with procedures. Procedures can be called from USE and HIERARCHY blocks only. This restriction enforces the concept that other block types (rule and window, for example) can not functionally decompose.
4-22
Other Statements
Other Statements
You can also use these statements in building your application with the templates: CALL Statement CALL SERVICE Statement SELECT Statement APPEND and REMOVE Statements TRAVERSE Statement UPDATE MESSAGE Statement SHOWMESSAGE Statement SET Statement
CALL Statement
The CALL statement allows one template to call another. Its syntax is:
CALL MODULE module_name FOR object , PASSING [ variable ]
IN TEMPLATE
template
This statement executes a module in a template for an object, just as if the object were passed from the user to the template. Although the syntax allows the object to be optional, the TurboCycler Standard Edition flags it as an error; this is a forward-looking language feature that supports the execution of a template without any repository object. The called template begins execution at the USE block that the FOR object names. The module_name and template parameters must be string expressions identifying the module name and template title (not its file name) to be run. The object parameter reduces to a repository object that the called template processes. The optional PASSING clause describes a list of variables common to both templates. You can use each variable for both input and output. A template can call itself. This is more efficient in space and time than calling another template. But keep the following points in mind: The user can run any module in a template for any USEENDUSE blocks. Because the template cannot hide its modules from the user, you must document which modules can be generated from each object type the template accepts, and instruct the user to initially configure the template from the setup dialog. The template must enforce the proper use of modules through programming. A template calling itself shares variables passed to it, but shares no others. Each invocation of the template creates new instances of its variables.
4-23
Other Statements
An error results if the requested template does not exist, does not have the requested module, or does not accept the object type passed. In the case of a CALL statement, a USE ANY block is not considered a match for the object type. The CALL MODULE statement is only allowed in USEENDUSE and HIERARCHYENDHIERARCHY statements.
PASSING
You can initiate user exits to interact with the user or to implement additional functionality beyond the previous capabilities of the templates language. The C header file (TCSDK.H) defines the application program interface for writing user exits. Also C:\appbuilder\template\samples\userexit contains sample user exit code for use as an example. You must put the user exit DLLs in the TurboCycler template directory on the development workstation.
SELECT Statement
TurboCycler Release 2.2.1 includes a selection construct for evaluating arbitrary case expressions. The syntax is: SELECT CASE expr1 : // statements ENDCASE CASE expr2 : // statements ENDCASE . . . DEFAULTCASE : // statements ENDCASE ENDSELECT
4-24
Other Statements
TRAVERSE Statement
The TRAVERSE statement allows the template to navigate a hierarchy by specifying an explode path and a series of procedures that should be called at each node. The purpose of the statement is to eliminate any explicit navigation logic from the template and to transform a recursive template algorithm into a finite automation: TRAVERSE root_object explode_path ENDTRAVERSE Here is an example showing the explode path: USE RULE( ROOT ) TRAVERSE ROOT ->VIEW VIA RELATION OWNS_VIEW : doView ->->FIELD VIA RELATION VIEW_INCLUDES : doField ->->RECURSE VIA RELATION VIEW_INCLUDES : doView ->RECURSE VIA RELATION USES_RULE : doRule ENDTRAVERSE ENDUSE In the example, the template is interested in finding all views, fields, and rules that are under the root rule. This is done by showing how the template should explode the hierarchy under the root object. In this case, the RECURSE statement is also usedit always refers to objects under the parent having the same type and related via the given relationship. It also specifies that the explosion should be repeated for these objects. Therefore, the first RECURSE refers to the VIEW object because the parent object (having one less arrow) is a VIEW. Furthermore, it says that for each VIEW found, all the explode lines leading to (and including) the RECURSE should be repeated. Note the following: ->VIEW VIA RELATION OWNS_VIEW : foo ->->FIELD VIA RELATION VIEW_INCLUDES : foo ->->RECURSE VIA RELATION VIEW_INCLUDES : foo Here all fields under the first view and all fields under every view under the first view will be seen. Compare this to: ->VIEW VIA RELATION OWNS_VIEW : foo ->->RECURSE VIA RELATION VIEW_INCLUDES : foo
4-25
Other Statements
->->FIELD VIA RELATION VIEW_INCLUDES : foo where only fields under the first view will be seen. However, views descending from the first view will be seen here, just as in the first example. The last item on the line is the name of the procedure that should be called whenever this node is seen. The procedure is called with four arguments, so it must declare four parameters: PROCEDURE foo REQUIRES [PAR, KID, LINK, LEVEL] // any block type where:
PAR KID LINK LEVEL = = = = the parent object the child object the relation between the parent and the child the depth in the hierarchy, starting at 1
Note
TRAVERSE statements cannot be nestedyou cannot start one while another is active because the whole purpose is to specify the complete explode path in the first one so there is no need to nest them. You can execute a STOP TRAVERSE statement from within a called procedure to prevent exploding children of the current child object. This is an easy way to stop traversing a particular branch after the template has decided it is no longer interested in those children.
Here is an example of a template: TEMPLATE Test traverse DESCRIPTION ENDDESCRIPTION USAGES USE FUNCTION (INFUNCTION) SET FILENAME = c:\\tra.out TRAVERSE INFUNCTION ->PROCESS VIA RELATION REFINES_INTO :test ->->RULE VIA RELATION IS_DEFINED_BY :test ->->->COMPONENT VIA RELATION USES_COMPONENT :test ->->->->RECURSE VIA RELATION COMPONENT_USES_COMPONENT :test ->->->RECURSE VIA RELATION USES_RULE :test ->->RECURSE VIA RELATION REFINES_INTO :test ENDTRAVERSE ENDUSE ENDUSAGES PROCEDURE REQUIRES [P, C, REL, DEPTH] FLATFILE test NAMED FILENAME SET Z = TYPEOF(C) + + (QUERY NAME OF C) UPDATE MESSAGE Z FOR I = 1 TO DEPTH {$(\t)} ENDFOR {$(TYPEOF(C)):$(QUERY NAME OF C)$(\n)} ENDFLATFIL
4-26
Other Statements
SHOWMESSAGE Statement
A new function is available for posting simple message boxes to the user. The syntax is: SHOWMESSAGE (caption, message, buttons, icon) The dialog has caption as its title and displays a message inside the dialog. The dialog can have one of the following values for buttons:
Table 4-4 Buttons OK OK CANCEL RETRY CANCEL ABORT RETRY IGNORE YES NO YES NO CANCEL Dialog Buttons Value 1 3 5 6 7 8
The function returns the button pressed to close the dialog. It will have one of the following values:
4-27
Note
SET Statement
A new statement for setting properties is available: SET property OF object = value This statement can now be used in WINDOW blocks to set properties of window controls. This is an alternative to using the HAVING clause of the MAKE statement. These properties can also be retrieved using the QUERY expression. TurboCycler now automatically creates a local variable named TCWINDOW upon entry to a WINDOW block. This variable refers to the window itself and may be used, for example, to set the CAPTION, ENTER_KEY, and CLOSE_KEY of the window: WINDOW Test NAMED TEST // window statements SET CAPTION OF TCWINDOW = Foobar ENDWINDOW
4-28
Common Statement
The common statement is a sequence of template language statements that originates in several block statements, such as USAGES, WINDOW, RULE, and HIERARCHY.
Caution
The flow diagrams indicate the common statement refers back only to the originating block statement, not indiscriminately to any other block statement. You must return to the block where you started.
For example, if you originate in the RULE block, the scope of its block statement includes this common statement and that particular rule statement directing you here. The block statement function, including this common statement, supports recursive execution.
RETURN return_code
DEBUG
ENDDEBUG block_statement by_expr ENDFOR block_statement string_expr int_expr list_expr object_expr ENDWHILE ENDIF
BY
RETURN Keyword to end the execution of a template for the passed-in object. Through the execution of this statement, you can pass back a specifiable return code. See return_code below for an explanation of the return codes. return_code Either an integer expression or string expression that indicates the reason for terminating the template. When the return code is: An integer, the number is not displayed to the user. Zero means successful completion. Nonzero signifies an error, so any module that depends on this execution should not continue. A string expression, it is displayed to the user and indicates an error. DEBUGENDDEBUG A pair of keywords that surround one or more statements to be analyzed. DEBUG produces output including a trace of the executed instructions, branch conditions, variable assignments, and repository queries. You cannot change or select the DEBUG output. Debug records output in a file specified in the DEBUG_FILE option in the Tools> Workbench Options, TurboCycler tab. You must set the fully qualified path and file name for your DEBUG file. You can also select to write the output only to a file. This will prevent the output from being displayed on the Analysis window in the Workbench.
4-29
block_statement A variable reference back to the block statement that invoked this common statement. The originator is one of the following block statements: usages block, rule block, window block, or hierarchy block. The block statement consists of this common statement and any unique instructions that are part of the block statement that invoked this common statement. A block statement and this common statement together can execute recursively, as the flow diagrams show. IFENDIF Keywords that surround a sequence of block statements. The IF control conditionally executes the statement(s) that follow. If the conditional expression is true, the block statement that immediately follows it are executed. The ELSE statement or the ENDIF indicate the end of the block. If the conditional statement is false, the ELSE statement is executed if it is present. conditional_expr A conditional expression the program tests for validity. If true, the next block statement(s) are executed; if false, the ELSE block statement(s) are executed. (The template language does not have an explicit THEN.) Refer to Conditional Expression (conditional_expr) on page 4-31 for the syntax. ELSE An alternative logic path that the program follows when the conditional expression of the IF is not true. FORENDFOR Keywords that surround a sequence of block statements. The FOR loop control executes a sequence of instructions repetitively for a specified number of iterations. The range of the from_expr (from expression) and the TO to_expr (to expression) defines the number of loop iterations. You can increment the count of iterations by a value other than one with the BY by_expr (by expression). loop_var Loop variable (an integer variable) that is the counter for the FOR loop. from_expr From expression (an integer expression) that sets the starting count for the FOR loop counter. TO Keyword that specifies the end-point value that limits loop repetitions. to_expr To expression (an integer expression) that sets the ending count for the FOR loop counter. BY Keyword that introduces the value for incrementing the loop count. Otherwise, the increment defaults to counting by one.
4-30
by_expr By expression (an integer expression) that sets the incrementing value for the FOR loop counter. WHILEENDWHILE Keywords that surround a sequence of block statements. The WHILE loop control executes a sequence of instructions repetitively until defined conditions are met. The (conditional_expr) parameter defines the conditions. (conditional_expr) A conditional expression, enclosed in required parentheses, that this program evaluates and acts on. While the conditional expression remains true, the following block statement(s) are executed. Refer to Conditional Expression (conditional_expr) on page 4-31 for the syntax. SET A keyword that assigns values to your variables, including string, integer, list, and object variables. = The equal sign that is the assignment operator. string_expr A string expression for string assignment. Refer to String Expression (string_expr) on page 4-43. int_expr An integer expression for integer assignment. Refer to Integer Expression (int_expr) on page 4-34. list_expr A list expression for a list assignment. Refer to List Expression (list_expr) on page 4-36. object_expr An object expression for an object assignment. Refer to Object Expression (object_expr) on page 4-38.
4-31
int_expr
int_expr
list _expr
= <>
list _expr
object_expr
= <>
object_expr
string_expr
= <> IN
string_expr
AND OR
conditional_expr
int_expr Any integer expression, as defined in Integer Expression (int_expr) on page 4-34. list_expr Any list expression, as defined in List Expression (list_expr) on page 4-36. Lists are equal when they have identical children in the same order. object_expr Any object expression, as defined in Object Expression (object_expr) on page 4-38. Objects are equal when they refer to identical repository objects. string_expr Any string expression, as defined in String Expression (string_expr) on page 4-43. Strings are equal when their characters match exactly. AND/OR Keywords that specify either an additional conditional expression or an alternative conditional expression that enhances the previous qualification. conditional_expr A conditional expression that can be added as another or an alternative conditional expression. (This usage supports recursive invocation of conditional expressions.)
4-32
Table 4-7 shows examples of conditional expressions and how they evaluate.
Table 4-7 Conditional Expressions Evaluation
Expression where X is 1 and Y is 2: x=y y=x x <> y where x is Field X and y is View X: x=y x <> y where x = TurboCycler and y = Turbo: x=y x <> y x IN y y IN x
False True
4-33
object_property
+ and Positive and negative arithmetic operators that act on the following digit parameter. digit Any numeral of one character. NUMBEROF A keyword that counts and reports the number of items in the list specified by the (list) parameter. (list) A list parameter (list expression) that identifies the list whose items are to be counted. Refer to List Expression (list_expr) on page 4-36 for more about list expressions. QUERY A keyword that retrieves information for the repository object that the repository_object parameter names. object_property A parameter that describes the property to be retrieved for the specified object type. Some object properties return strings, others integers. Only object properties having and returning integer values are valid for the integer expression. Refer to Object Types and Properties on page 5-3 for details.
4-34
OF A keyword that identifies the repository_object being queried. repository_object An object expression that defines the repository object for which numeric information is being obtained. int_var An integer variable in the template that has an integer value. (int_expr) Any integer expression, as defined in Integer Expression (int_expr) on page 4-34. The parentheses are optional, but you can use them to improve readability and to resequence the order of operators. int_expr An integer expression that you can use with the following arithmetic operators to derive calculated values. */+Arithmetic operators that function with the surrounding integer expressions and evaluate to an integer value. RIGHTOF/LEFTOF/TOPOF/BOTTOMOF/HEIGHTOF/WIDTHOF Limited to window block statements, these keywords retrieve the dimensions of window control parameters. (window_control) A window control variable that refers to a window that the MAKE or CONTAIN statement creates. Refer to WINDOW Block.
4-35
ORDER BY
[ property ]
list_var A list variable in the template that refers to an object in the repository. (list_expr) Any list expression enclosed in parentheses to improve readability. CHILD PARENT Keywords that retrieve a list of children or parents of a given object. These keywords serve as the repository interface to promote navigation from object to object. criteria_object_type S The object types of the children or parents to be retrieved from the list. The trailing character S signifies a list of objects is to be retrieved. The plural form of any object type supported by the Information Model is valid, such as RULES, WINDOWS, VIEWS, and FIELDS. (Note that plurals are constructed by putting the suffix S on the base word, with these exceptions: ENTITIES, PROCESSES, and LOGICAL_PROCESSES.) Refer toObject Types and Properties on page 5-3 for a list of object types. OF A keyword that introduces the root_object parameter as the point to begin navigation. root_object An object expression that refers to the object from which you want to start navigation.
4-36
HAVING A keyword that specifies properties the list of children or parent must have. [] A set of brackets enclosing the values of properties that must be met for the retrieved objects. criteria_property Criteria property (an object property expression) that specifies the values that the properties of the retrieved child/parent objects must have. Refer to Object Types and Properties on page 5-3 for a complete list. AND/OR Keywords that specify either an additional criteria_property or an alternative criteria_property that modifies the previous qualification. VIA RELATION A keyword that specifies the relationship type between children or parents. This is a required parameter. criteria_relation_type Criteria relation type (a relation type expression) that specifies the type of relationship to the children/ parent objects. Refer to Relationship Types and Properties on page 5-12 for a detailed list. WITH A keyword that specifies required properties of the relationship (with children or parents) to the object. criteria relation property Criteria relation type (a relation property expression) that specifies the values the properties of the relationship to the retrieved child/parent objects must have. Refer to Relationship Types and Properties on page 5-12 for a detailed list. ORDER BY Sorts the list by the properties specified. Properties can apply to either the entity or the relationship.
Note
4-37
object_type
GET
criteria_object_type criteria_object_typeS
NAMED
object_name
DERIVED KEY OF
logical_object
FOR
entity_qualifier
ORIGINATING IDENTIFIER OF
ORIGINATING RELATIONSHIP OF
referred_key_qualifier
The last four flow lines address traceability data that the forward engineering and reverse engineering processes create. Details about these appear later. object_var An object variable in the template that refers to an object in the repository. (object_expr) Any object expression that can be enclosed in parentheses to improve readability.
4-38
object_list A list expression that represents a list of objects in the repository, which you index for a specific item in the list. The index is the offset of the item being accessed. [] A set of brackets that index into a list of objects. RELATION A keyword that refers to a relationship to the specified object in the repository (not to the object itself). Use this expression to obtain sequence number information among other data. list_index An integer expression that is the index into the object list. The first item in a list has an index value of one (1). CHILD/PARENT Keywords that retrieve a list of children or parents of a given object. These keywords serve as the repository interface to promote navigation from object to object. They return only the first qualified object encountered. Refer to Figure 4-3 for a coding example using CHILD and related parameters. object_type An object type of the child or parent to be retrieved. Refer to Object Types and Properties on page 5-3 for a list of object types. OF A keyword that introduces the root_object parameter as the navigation starting point. root_object An object expression that refers to the object from which you want to start navigation. [] A set of brackets that enclose the values of properties the child/parent object must have. criteria_property Criteria property (an object property expression) that requires the child or parent object to have the specified value for the property. Refer toObject Types and Properties on page 5-3 for a detailed list. Examples of the format for this statement are PROPERTY = string_expr and PROPERTY = int_expr. AND/OR Keywords that specify either an additional criteria_property or an alternative criteria_property that modifies the previous qualification. VIA RELATION A keyword that specifies the relationship type between the child or parent. (Note this is a required parameter.) Refer to Figure 4-3 on page 4-42 for a coding example using VIA RELATION and related parameters.
4-39
criteria_relation_type Criteria relation type specifies the type of relationship to the child/parent object. Refer to Relationship Types and Properties on page 5-12 for details. WITH A keyword that specifies requisite properties of the relationship (with a child or parent) to the object. Refer to Figure 4-3 on page 4-42 for a coding example using WITH and related parameters. criteria_relation_property Criteria relation type (a relation property expression) that specifies the values the properties of the relationship to the child/parent object must have. GET A keyword that specifies repository objects to be retrieved. Allows conditional queries of repository objects. criteria_object_type A property that specifies the type of the object being retrieved. Refer to Object Types and Properties on page 5-3 for a list of valid object types. When the criteria_object_type parameter is not plural, this expression retrieves a single repository object. When criteria_object_type is plural, the expression retrieves any number of objects of the specified type from the repository. NAMED A keyword that identifies the object_name parameter. HAVING A keyword that specifies properties the child or parent must have. Use the HAVING clause to select a subset of these objects. Refer to Figure 4-3 on page 4-42 for a coding example using HAVING and related parameters. object_name A string expression that specifies the name of the object to be retrieved. The object_name parameter can optionally contain a single asterisk (*) as the last character. When accessing the members of the resulting list, the RELATION subscript modifier has no meaning. DERIVED KEY OF A keyword that obtains the key that implements an identifier or a relationship in the repository. To understand key usage with relationships or identifiers, you must understand how forward engineering handles keys. Forward engineering begins with an entity relationship diagram, which consists of entities, attributes, relationships, and identifiers. The forward engineering process turns those objects into a database diagram consisting of tables, keys, and columns. As part of this activity, forward engineering links keys to relationships to produce a foreign key and links keys to identifiers to produce a primary or index key. Consequently, the following TurboCycler functions occur: DERIVED KEY OF Relationship (provides a foreign key) DERIVED KEY OF Identifier FOR entity_qualifier (provides a primary or index key)
4-40
logical_object An object expression that is either an ERD relationship or an identifier. If a relationship, it is not qualified by the entity_qualifier and does return a foreign key. If an identifier, it must be qualified by its owning entity and returns a primary or an index key. FOR A keyword that introduces the entity_qualifier parameter. This phrase applies only to an identifier object that is querying for a primary or index key. entity_qualifier An object expression that names the entity for which an identifier is being sought. ORIGINATING IDENTIFIER OF A keyword that starts the query for an identifier by searching through its primary or index key. This function is the reverse of the DERIVED KEY OF logical_object FOR entity_qualifier function, described above. In this case, you supply the key and receive the identifier object. identifier_created_key An object expression that names the primary or index key from which you receive the corresponding identifier object. ORIGINATING RELATIONSHIP OF A keyword that initiates the query for a relationship by searching through its foreign key. This function is the reverse of the logical_object on page 4-41 . In this case, you supply the key and receive the relationship object. relationship_created_key An object expression that names the foreign key through which you obtain the corresponding relationship object. REFERRED COLUMN OF A keyword that returns a column object that is referred by another column when two tables are connected by a foreign key. To understand referred column queries between tables with keys, you must understand how tables, keys, and columns are structured in database diagrams. If two tables have columns connected by a foreign key, you can extract column objects about one by using the key data from the other. For instance, consider the following example: REFERRED COLUMN OF columnf FOR forkey In this example, you supply a foreign key column (columnf) and the foreign key (forkey) and receive the referred column object of the foreign key that columnf is referred by. Now here is another example: REFERRED COLUMN OF columnp FOR prikey TO forkey In this example, you supply the primary key column (columnp) and the primary or index key (prikey) referred by the foreign key (forkey) and receive the foreign key column object that is referring to columnp. Refer to Figure 4-4 on page 4-43 for a visual representation of these examples of the REFERRED COLUMN OF keyword.
4-41
original_column An object expression that names the column object from which the search begins. FOR A keyword that names the key_qualifier through which searching starts. key_qualifier An object expression that identifies the key that is searched for the desired response object. TO A keyword that names the foreign key, as described in the second example of the REFERRED COLUMN OF keyword. referred_key_qualifier An object expression that names the foreign key, as described in the second example of the REFERRED COLUMN OF keyword. Additional information Figure 4-3 shows a coding example of the CHILD entity type, HAVING, VIA RELATION, and WITH. Deleting Objects A keyword that specifies repository objects to be deleted. Delete (object_expr)
Figure 4-3 Sample of a Hierarchy Diagram Coded as an Object Expression
Sample of a Hierarchy Diagrammer FILE (1) F (3) VIEW (2) V (5) (5) (5) FLD (4) FLD (4) FLD (4) A CHAR(1) B INTEGER C SMALLINT
Essential elements of the hierarchy (1) File: F (2) View: V (3) Relationship: OWNS_VIEW (4) Fields A, B, and C (5) Relationship: VIEW_INCLUDES
4-42
Figure 4-4 shows an example of a diagram and flow for the REFERRED COLUMN OF statement.
Figure 4-4 Example of REFERRED COLUMN OF coding
Example of tables and columns connected by foreign key relationship: TABLE EMPL TABLE EMPL
COLUMN
DEPT_ID
COLUMN
KEY
(foreign key)
KEY
KEY (B)
(refers to)
(A) Sample of template language coding: (1) REFERRED COLUMN OF columnf (A) FOR forkey (B) (2) REFERRED COLUMN OF columnp (C) FOR prikey (D) TO forkey (B). Results: (1) Statement 1 queries A and B, returning column C. (2) Statement 2 queries C and D, returning column A.
repository_object
4-43
Lexical analysis of string literals The backslash character (\) is the escape sequence in string literals. Supported escape sequences are described in Table 4-8.
Table 4-8 Escape Sequences Description Backslash Horizontal tab (HT) Vertical tab (VT) Backspace (BS) Newline (LF) Carriage return (CR) Form feed (FF) Alert (BEL) Double quote Hex number (all three digits required)
Characters \\ \t \v \b \n \r \f \a \ \xhhh
Caution
Use the double backslash for file names. For example: SET myDirectory = G:\\HPS\\
SUBSTR () A keyword that retrieves a specified character substring from the original_string parameter. original_string A string expression that identifies the character string from which the SUBSTR retrieves a substring. from_expr An integer expression that indicates the starting point of the original_string parameter of retrieved data. to_expr An integer expression that indicates the end point of the original_string parameter of retrieved data. QUERY A keyword that retrieves property information for the repository object that is named by the repository_object parameter. object_property A parameter that describes the property to be retrieved for the specified object type. Some object properties return strings, others integers. Only the object properties having and returning string values are valid for the object expression. Refer toObject Types and Properties on page 5-3 for a complete list. OF A keyword that identifies the repository_object parameter being queried.
4-44
repository_object An object expression that defines the repository object for which character string information is being obtained. string_var A string variable in the template that has a character value. (string_expr) Any string expression, as defined on page 4-43. The parentheses are optional, but you can use them to improve readability. + string_expr A string expression that concatenates another string expression to the one just completed.
4-45
// Query for relationship lines coming into the entity SET LINES = CONNECTED RELATIONSHIP_LINES OF ENTITYSYMBOL VIA CONNECTION RELATION_IN SET REPO_OBJECT = QUERY ASSOCIATED_OBJECT OF LINES(1) SET REPO_LINK = QUERY ASSSOCIATED_OBJECT OF LINES(CONNECTION 1) In the last two lines, repository objects of types RELATIONSHIP and IS_RELATED_VIA are returned, respectively. Notice that these statements have a very strong analogy to the TurboCycler CHILD...VIA RELATION and RELATION array subscript modifier statementsthey are meant to work in the same way for drawing symbols. Table 4-9 through Table 4-13 lists the symbols associated with different types of diagrams.
Table 4-9 Entity Relationship Diagrammer Plural Name n/a n/a n/a n/a ENTITIES BUSINESS_OBJECTS RELATIONSHIP_LINES SUBTYPE_LINES NOTES Symbol Type connection connection connection connection box box line line box
Symbol Name RELATION_OUT RELATION_IN SUBTYPE_OUT SUBTYPE_IN ENTITY BUSINESS_OBJECT RELATIONSHIP_LINE SUBTYPE_LINE NOTE
Table 4-10 State Transition Diagrammer Symbol Name IS_PRECONDITION IS_POSTCONDITION EVENT_CLAUSES STATE EVENT TRANSITION_LINE Plural Name n/a n/a n/a STATES EVENTS TRANSITION_LINES Symbol Type connection connection connection box box line
Table 4-11 Database Diagrammer Symbol Name REFERRED_OUT REFERRED_IN HAS_OUT HAS_IN TABLE KEY FOREIGN_KEY INDEX_KEY HAS_KEY_LINE Plural Name n/a n/a n/a n/a TABLES KEYS FOREIGN_KEYS INDEX_KEYS HAS_KEY_LINES Symbol Type connection connection connection connection box box box box line
4-46
Table 4-11 Database Diagrammer (Continued) Symbol Name REFERRED_KEY_LINE Plural Name REFERRED_KEY_LINES Symbol Type line
Table 4-12 Process Dependency Diagrammer Symbol Name DEPEND_OUT DEPEND_IN TRIGGER_OUT TRIGGER_IN EVENT_TRIGGER_IN EVENT_TRIGGER_OUT LOGICAL_PROCESS DECISION TRIGGER_LINE DEPENDENCY_LINE EVENT_TRIGGER_LINE Plural Name n/a n/a n/a n/a n/a n/a LOGICAL_PROCESSES DECISIONS TRIGGER_LINES DEPENDENCY_LINES EVENT_TRIGGER_LINES Symbol Type connection connection connection connection connection connection box box line line line
Table 4-13 Window Flow Diagrammer Symbol Name FLOW_OUT FLOW_IN NEST_OUT NEST_IN EVENT_OUT EVENT_IN DETACH_OUT DETACH_IN RULE_INITIATES DECISION_OUT DECISION_IN DECISION_NEST_OUT PROCESS ENTRY_POINT DIALOG_UNIT WINDOW RULE DECISION TERMINAL FLOW_LINE NESTED_FLOW_LINE DETACHED_FLOW_LINE MESSAGE_FLOW_LINE Plural Name n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a PROCESSES ENTRY_POINTS DIALOG_UNITS WINDOWS RULES DECISIONS TERMINALS FLOW_LINES NESTED_FLOW_LINES DETACHED_FLOW_LINES MESSAGE_FLOW_LINES Symbol Type connection connection connection connection connection connection connection connection connection connection connection connection box box box box box box box line line line line
4-47
Functions
Functions
The TurboCycler Developers Kit comes with a number of commonly needed functions to assist you in building your templates. Get and File Functions String Manipulation Functions Superseded Functions
GetEnvironment (environment_variable)
This function retrieves the value of any environment_variable. If the requested variable is not defined, an empty string is returned.
4-48
Functions
Note
In Windows NT, the HPSINI file cannot be read using the GetHPSConfiguration function. However, AppBuilder can use the registry for the TurboCycler GetHPSConfiguration function. The following sample key and values illustrate how you can set up the the logic:
[HKEY_LOCAL_MACHINE\SOFTWARE\BluePhoenix\Appbuilder\IDWB\Tools\TurboCycler\ Settings] "Copyright1"="copyright CompanyName 2003" "Copyright2"="copyright OtherName 1999"
GetTime (format_string)
This function uses the format_string parameter to generate a string containing the current date or time information. The format_string is composed of text and, optionally, one or more of the conversion specifiers described in Table 4-14:
Table 4-14 Conversion Specifiers Specifier %a %A %b %B %c %d %H %I %j %m %M %p %S %U %w %W %x %X %y %Y %z %% Description Abbreviated weekday name Full weekday name Abbreviated month name Full month name Date and time Day of the month Hour of the 24-hour day Hour of the 12-hour day Day of the year, from 001 Month of the year, from 01 Minutes after the hour, from 00 AM/PM indicator (AM) Seconds after the minute, from 00 Sunday week of the year, from 00 Day of the week, from 0 for Sunday Monday week of the year from 00 Date Time Year of the century, from 00 Year Time zone name, if any Percent character Example Sun Sunday Dec December Dec 02 1995 06:55:15 02 23 11 335 12 55 AM 48 51 0 43 Dec 02 1995 06:55:15 95 1995 EST %
Using any other % character in the format string is illegal, and an empty string is returned.
4-49
isDefined (variable_name)
This function returns 1 if the variable_name is defined as a variable in the template; otherwise, it returns 0. This function allows the template to determine whether it is being executed by the user or another template.
NewFilename ( )
This function generates a unique file name.
removeFile (file_name)
This function attempts to delete the file specified by the file_name parameter. It returns 1 if successful or 0 if unsuccessful.
ReadFlatFile(pathname)
TurboCycler reads in text files using the READFLATFILE (pathname) function. The function returns a string containing the text file. Only text files smaller than 64K can be read using this function.
strCenter (str, length, pad) Returns a string of length with str centered. Remaining spaces are filled using pad. strCopies (str, n) Returns a string of n concatenated copies of str. strCutLeft (str, length) Returns str with the leftmost length characters removed. strCutMiddle (str, start, length) Returns str with length characters starting at position start removed. strCutRight (str, length) Returns str with the rightmost length characters removed. strFilespec (str, option) Returns the part of the file name in str specified by option. The option can be: Drive, Dir, Name, or Extension.
4-50
strFind (needle, haystack, int n) Returns the position of the nth occurrence of needle in haystack. strInsert (needle, haystack, n) Inserts needle in haystack at position n. strLeft (str, length) Returns a string comprised of the leftmost length characters of str. strLength (str) Returns the number of characters in str. strLine (str, i) Returns the i the line in str. strLines (str) Returns the number of lines in str, separated by carriage returns. strLower (str) Converts str to lower case. strMiddle (str, start, length) Returns a string comprised of length character taken from str beginning at position start. strReplace (search, replace, str) Replaces each occurrence of the string search in str with the string replace. The search is case insensitive. strReverse (str) Returns a string comprised of the characters from str in reverse order. strRight (str, length) Returns a string comprised of the rightmost length character of str. strToken (str, delimiter_set, n) Returns the nth token in str, using the characters in delimiter_set as delimiters. strTokens (str, delimiter_set) Returns the number of tokens in str separated by any of the characters in delimiter_set. strTrim (str, option) Returns str without leading or trailing white space. The option can be: Leading, Trailing, or Both. strUpper (str) Converts str to upper case.
4-51
Superseded Functions
strWord (str, i) Returns the i the word in str. strWords (str) Returns the number of words in str, separated by white space.
Superseded Functions
Previous releases of TurboCycler Developers Kit provided functions and statements that have since been superseded. The use of these functions and statements is discouraged. A listing of these functions is shown in Table 4-15.
Table 4-15 Superseded Functions For these functions: RIGHTOF() LEFTOF() WIDTHOF() HEIGHTOF() Use:
Use: The SET property statement instead: SET BOTTOM OF TCWINDOW = 50 SET LEFT OF TCWINDOW = 50 SET WIDTH OF TCWINDOW = 200 SET HEIGHT OF TCWINDOW = 150
Template Samples
The TurboCycler Developers Kit provides two sample templates: the SQL Delete Rule sample, which is part of the CRUD Rules template, and the Detail Display rule/window sample, which is part of the GUI Rules/Windows template. These samples demonstrate many of the features available in the template language. The samples are located in the directory HPS\AD\TEMPLATES\SAMPLES. The following samples show how to generate object hierarchies, rules, and a window. The SQL Delete Rule Sample is described first, then the Detail Display Rule and Window Sample.
Note
Source code for all the Standard Edition templates is included with the TurboCycler Developers Kit in the directory APPBUILDER\AD\TEMPLATES.
Samples include: SQL Delete Rule Sample Detail Display Rule and Window Sample
4-52
Template Samples
4-53
Template Samples
REM --- Verify that we have a file implementation name ---; IF MyFileImplementation = RETURN The file does not have an implementation name. ENDIF REM --- Verify that all primary fields have an implementation name ---; FOR I = 1 TO NUMBEROF(MyPrimeFields) IF (QUERY IMPLEMENTATION_NAME OF MyPrimeFields(I)) = SET MESSAGE = The primary field + (QUERY NAME OF MyPrimeFields(I)) + does not have an implementation name. RETURN MESSAGE ENDIF ENDFOR ENDUSE ENDUSAGES REM ---------------------------------------------------------SQL Delete Rule Modules -------------------------------------------------------------; REM -------------------------------------------------------; HIERARCHY SQL Delete Rule REM --- Create Strings for SQL Delete Rule Modules ---; SET DeleteRuleName = (SUBSTR (MyFileName, 1, 19) ) + _SQL_DEL SET DeleteRuleIV = DeleteRuleName + _IV SET DeleteRuleOV = DeleteRuleName + _OV REM --- Build Hierarchy for the SQL Delete Rule ---; -> RULE DeleteRuleName [DBMS = DB2] ->-> FILE MyFileName VIA RELATION ACCESSES [SEQUENCE_NUMBER = 10] ->-> VIEW DeleteRuleIV VIA RELATION OWNS_VIEW [VIEW_USAGE = Input, SEQUENCE_NUMBER = 20] ->-> VIEW DeleteRuleOV VIA RELATION OWNS_VIEW [VIEW_USAGE = Output, SEQUENCE_NUMBER = 30] REM --- Build Hierarchy for the SQL Delete Rule Input View ---; -> VIEW DeleteRuleIV ->-> VIEW MyPrimeView VIA RELATION VIEW_INCLUDES [SEQUENCE_NUMBER = 10] REM --- Build Hierarchy for SQL Delete Rule Output View ---; -> VIEW DeleteRuleOV ->-> FIELD RETURN_CODE VIA RELATION VIEW_INCLUDES [SEQUENCE_NUMBER = 10] ENDHIERARCHY
4-54
Template Samples
RULE SQL Delete Rule NAMED DeleteRuleName { *>--------------------------------------------------------<* *>- Rule: $(DeleteRuleName) -<* *>- SQL Delete Rule for the File: $(MyFile). -<* *>- Automatically Generated by TurboCycler. -<* *>-------------------------------------------------------<* SQL ASIS DELETE FROM $(MyFileImplementation) WHERE } FOR I = 1 TO NUMBEROF(MyPrimeFields) { $(QUERY IMPLEMENTATION_NAME OF MyPrimeFields(I)) = :$(DeleteRuleIV).$(MyPrimeFields(I)) } IF I <> NUMBEROF(MyPrimeFields) {AND } ENDIF ENDFOR { ENDSQL IF SQLCODE = 0 SQL ASIS COMMIT ENDSQL ENDIF MAP SQLCODE TO RETURN_CODE } ENDRULE
4-55
Template Samples
In the window block, the template makes several controls, including a static text and edit field for every field in the data view. In doing this, a variable (MyBottom) stores the current value of the bottom position of the next window control. This template also creates a simple menu hierarchy and includes a bit map in the top left corner of the screen. It is important to understand how the template maintains the size and position of the window. TEMPLATE Detail Display Sample DESCRIPTION Generates a Detail Display Rule and Window for a AppBuilder File Object. ENDDESCRIPTION USAGES USE FILE(MyFile) REM --- Query repository for information needed by blocks ---; SET MyDataView = CHILD VIEW OF MyFile VIA RELATION OWNS_VIEW WITH [VIEW_USAGE = DATA] SET MyFields = CHILD FIELDS OF MyDataView VIA RELATION VIEW_INCLUDES SET MyFileName = QUERY NAME OF MyFile ENDUSE USE ALL REM --- Verify there is a data view ---; IF MyDataView = 0 RETURN The file does not have a data view. ENDIF REM --- Verify the data view has fields ---; IF (NUMBEROF(MyFields)) = 0 RETURN The data view does not have any fields. ENDIF REM --- Set up Strings needed by blocks ---; SET MyClonedDataView = (SUBSTR (MyFileName, 1, 19) ) + _CDV SET MyDetailRule = (SUBSTR (MyFileName, 1, 16) ) + _SAMPLE_DETAIL SET MyDetailWindow = (SUBSTR (MyFileName, 1, 16) ) + _SAMPLE_DETAIL SET MyProcessName = (SUBSTR (MyFileName, 1, 19) ) + _MAINT ENDUSE ENDUSAGES REM --- Detail Display Function/Process/Rule Hierarchies ---; HIERARCHY Detail Display REM --- Create the Function/Process hierarchy ---; -> FUNCTION MyFileName [MENU_DESCRIPTION = MyFileName]
4-56
Template Samples
->-> PROCESS MyProcessName [MENU_DESCRIPTION = MyFileName + Maintenance] VIA RELATION REFINES_INTO [SEQUENCE_NUMBER = 10] REM --- Attach a root rule to the Process ---; -> PROCESS MyProcessName ->-> RULE MyDetailRule VIA RELATION IS_DEFINED_BY [SEQUENCE_NUMBER = 10] REM --- Create the Detail Display Rule Hierarchy ---; -> RULE MyDetailRule ->-> WINDOW MyDetailRule VIA RELATION CONVERSES_WINDOW [SEQUENCE_NUMBER = 110] ->-> VIEW HPS_EVENT_VIEW VIA RELATION OWNS_VIEW [SEQUENCE_NUMBER = 120, VIEW_USAGE = WORK] ENDHIERARCHY REM --- Detail Display Rule Source Code ---; RULE Detail Display NAMED MyDetailRule { *>--------------------------------------------------------<* *>- Rule: $(MyDetailRule) -<* *>- Detail Display Rule for the File: $(MyFile). -<* *>- Automatically Generated by TurboCycler. -<* *>--------------------------------------------------------<* do while EVENT_SOURCE <> Exit map TIME to STATUS_TIME map DATE to STATUS_DATE converse window $(MyDetailRule) caseof EVENT_SOURCE case New clear $(MyDetailRule) endcase enddo } ENDRULE REM --- Detail Display Window Hierarchy ---; HIERARCHY Detail Display REM --- Create the Window Hierarchy ---; -> WINDOW MyDetailWindow ->-> VIEW MyDetailWindow VIA RELATION OWNS_VIEW [SEQUENCE_NUMBER = 10] REM --- Create the Window View Hierarchy ---; -> VIEW MyDetailWindow ->-> FIELD STATUS_DATE [TYPE = DATE, LENGTH = 4] VIA RELATION VIEW_INCLUDES [SEQUENCE_NUMBER = 10] ->-> FIELD STATUS_TIME [TYPE = TIME, LENGTH = 4]
4-57
Template Samples
VIA RELATION VIEW_INCLUDES [SEQUENCE_NUMBER = 20] ->-> VIEW MyClonedDataView VIA RELATION VIEW_INCLUDES [SEQUENCE_NUMBER = 30] REM --- Clone the data view in the window view ---; -> VIEW MyClonedDataView FOR X = 1 TO NUMBEROF(MyFields) ->-> FIELD (QUERY NAME OF MyFields(X)) VIA RELATION VIEW_INCLUDES [SEQUENCE_NUMBER = (10*X)] ENDFOR ENDHIERARCHY REM --- Detail Display Window Panel ---; WINDOW Detail Display NAMED MyDetailWindow SET MyCDV = GET VIEW NAMED MyClonedDataView REM --- Make the Detail Display Menu ---; -> MENUITEM &File ->-> MENUITEM &New [HPSID = New] ->-> SEPARATOR ->-> MENUITEM &Print [HPSID = HPS_MENU_PRINT] ->-> SEPARATOR ->-> MENUITEM E&xit [HPSID = Exit] -> MENUITEM &Edit ->-> MENUITEM &Cut ->-> MENUITEM Co&py ->-> MENUITEM &Paste
REM --- Set up area information ---; SET MyWidth = 440 SET MyBottom = (20 + (29 * (NUMBEROF(MyFields) - 1))) REM --- Place all edit fields ---; FOR X = 1 TO NUMBEROF(MyFields) MAKE STATIC_TEXT HAVING [HPSID = ID + (QUERY NAME OF MyFields(X)), LEFT = 20, TEXT = (QUERY SCREEN_LITERAL OF MyFields(X)), BOTTOM = MyBottom, WIDTH = 150, HEIGHT = 19, FONT = SWISS8] ENDMAKE REM --- PROCEDURE TO DETERMINE WIDTH OF FIELD ---; SET FieldType = QUERY TYPE OF MyFields(X) SET FieldLength = QUERY LENGTH OF MyFields(X) IF FieldType = INTEGER IF FieldLength = 15 SET ControlWidth = 60
4-58
Template Samples
ELSE SET ControlWidth = 100 ENDIF ELSE IF FieldType = DATE OR FieldType = TIME SET ControlWidth = 100 ELSE SET ControlWidth = 7 * FieldLength IF ControlWidth < 30 SET ControlWidth = 30 ENDIF ENDIF ENDIF MAKE EDIT_FIELD edit HAVING [HPSID = (QUERY NAME OF MyFields(X)), LEFT = 175, BOTTOM = MyBottom, HEIGHT = 19, WIDTH = ControlWidth, FONT = SWISS8, TABSTOP = TRUE] LINKED TO MyFields(X) OF MyCDV ENDMAKE SET MyBottom = MyBottom - 29 IF (RIGHTOF(edit) + 20) > MyWidth SET MyWidth = RIGHTOF(edit) + 20 ENDIF ENDFOR REM --- Reset the bottom to be above all edit fields ---; SET MyBottom = 20 + (29 * NUMBEROF(MyFields)) + 15 REM --- Place Bitmap/Status Information Above Edit Fields ---; MAKE BITMAP HAVING [HPSID = HPS, BOTTOM = MyBottom, HEIGHT = 50, ENDMAKE
MAKE PROTECTED_EDIT_FIELD HAVING [HPSID = STATUS_DATE, LEFT = 80, BOTTOM = MyBottom + 31, HEIGHT = 19, WIDTH = 60, FONT = SWISS8, TABSTOP = FALSE] LINKED TO (GET FIELD NAMED STATUS_DATE) ENDMAKE MAKE PROTECTED_EDIT_FIELD HAVING [HPSID = STATUS_TIME,
LEFT = 80,
4-59
Template Samples
BOTTOM = MyBottom, HEIGHT = 19, WIDTH = 60, FONT = SWISS8, TABSTOP = FALSE] LINKED TO (GET FIELD NAMED STATUS_TIME) ENDMAKE SET MyBottom = MyBottom - 2 MAKE RECTANGLE HAVING [HPSID = Line, BOTTOM = MyBottom, HEIGHT = 1] ENDMAKE SET MyBottom = MyBottom + 50 REM --- Size and Position the window ---; SIZE WINDOW MyWidth BY (MyBottom + 45) POSITION WINDOW AT 50, 50 ENDWINDOW
4-60
CHAPTE
Repository Types and Properties describes the object types in the Information Model that TurboCycler can access or generate. The Information Model defines the objects an AppBuilder repository can contain. Repository objects include entities and relationships. The Information Model describes the entity types and relationship types they can have with each other. These objects have properties that you can query or set. Some properties have a set of values called a domain. Refer to the Information Model for complete descriptions of entity types, relationship types, and their properties. Repository Types and Properties describe the types of objects, the relationships between them, and the properties of each that you can use in template language statements. This includes: Object Types and Properties Relationship Types and Properties Property Domains First, there is a short description on how to access repository information. The next section shows a short example of template language statements using repository types and properties. Then, object and relationship types and their corresponding properties are described. Repository Types and Properties ends with a list of the domains for properties that have them.
Note
All object query statements return lists that are automatically sorted by sequence number.
5-1
ViewUsage
In the following example, the ViewUsage domain controls the values listed below. ViewUsage ALTERNATE DATA INPUT OUTPUT WORK CANDIDATE FOREIGN INPUT/OUTPUT PRIMARY
You can find a view with VIEW_USAGE 'output' or VIEW_USAGE 'input/output'. However, combining them using the syntax: [View_USAGE = "INPUT/OUTPUT" or VIEW_USAGE = "INPUT"] is not valid. TurboCycler does not recognize the "or" as a condition statement if it is inside the bracket. Use the syntax: [VIEW_USAGE = "INPUT/OUTPUT"] or [VIEW_USAGE = "INPUT"] to achieve the desired result.
5-2
AUDIT_PROPERTIES APPLICATION_CONFIGURATION ATTRIBUTE BITMAP BITMAP_IMPLEMENTATION BUSINESS_OBJECT CELL COLLECTIONCOLUMN COMPONENT PARTITION DATABASE DATA_STORE DATA_TYPE DRAWING ENTITY EVENT FIELD FILE FSDM_SCHEME FSDM_VALUE FUNCTION HELP
All object types have the properties OBJECT_TEXT and OBJECT_KEYWORDS. For example: SET X = QUERY OBJECT_TEXT OF Y The result of this expression is to store the TEXT of object Y as a string in variable X. Additionally, there are audit properties that are common to all objects in the Workgroup repository (also referred to as Freeway). Table 5-2 is a list of the audit properties and their character restrictions:
Table 5-2 Properties FWY_PROJECT FWY_USER FWY_DATE FWY_TIME FWY_LOCKOWNER FWY_OWNER Workgroup Repository Audit Properties Character Restriction char 10 char 10 char 8 char 8 char 10 char 10
5-3
AUDIT_PROPERTIES
All entities have the read-only audit properties listed in Table 5-4. The tables that follow list specific properties for each entity individually.
Table 5-3 Entity List IDENTIFIER KEY LOCATION LOGICAL_PROCESS MACHINE ORGANIZATION PANEL PROCESS RELATIONSHIP REPORT RULE SECTION SERVER SET STATE SYSTEM TABLE TRANSITION VALUE VIEW WINDOW WINDOW_CONTENT
APPLICATION_CONFIGURATION ATTRIBUTE BITMAP BITMAP_IMPLEMENTATION BUSINESS_OBJECT CELL COLLECTION COLUMN COMPONENT PARTITION DATABASE DATA_STORE DATA_TYPE DRAWING ENTITY EVENT FIELD FILE FSDM_SCHEME FSDM_VALUE FUNCTION HELP
Table 5-4
APPLICATION_CONFIGURATION
Table 5-5 NAME APPLICATION_CONFIGURATION Read-Only Audit Properties SYSID
5-4
ATTRIBUTE
Table 5-6 ATTRIBUTE Read-Only Audit Properties NAME
BITMAP
Table 5-7 BITMAP Read-Only Audit Properties NAME TYPE: BmpType
IMPLEMENTATION_NAME SYSID
BITMAP_IMPLEMENTATION
Table 5-8 BITMAP_IMPLEMENTATION Read-Only Audit Properties COLOR_PLANE BITMAP_IMPLEMENTATION_DESCRIPTION RESERVED TYPE: BMPFormatType X_SIZE Y_SIZE
BUSINESS_OBJECT
Table 5-9 BUSINESS_OBJECT Read-Only Audit Properties NAME TYPE: BusinessObjectType
BUSINESS_OBJECT_DESCRIPTION SYSID
CELL
Table 5-10 CELL Read-Only Audit Properties NAME SYSID PROTOCOL: Protocol
COLLECTION
Table 5-11 COLLECTION Read-Only Audit Properties NAME NUMBER_OF_ELEMENTS SYSID NATURE: CollectNature NUMBER_OF_GROUPS TYPE
5-5
COLUMN
Table 5-12 COLUMN Read-Only Audit Properties AVE_LENGTH LENGTH SCALE TYPE: FieldType IMPLEMENTATION_NAME NAME SYSID
COMPONENT
Table 5-13 COMPONENT Read-Only Audit Properties DBMS_USAGE: CompDBMSUsage EXECUTION_MODE: ExecutionMode LANGUAGE: Language SOURCE_FILE ENVIRONMENT: CompExecEnv IMPLEMENTATION_NAME NAME SYSID
DATABASE
Table 5-14 DATABASE Read-Only Audit Properties IMPLEMENTATION_NAME NAME TYPE: DBMStype MACHINE_NAME SYSID
DATA_STORE
Table 5-15 DATA_STORE Read-Only Audit Properties DATA_STORE_DESCRIPTION SYSID NAME
DATA_TYPE
Table 5-16 DATA_TYPE Read-Only Audit Properties FRACTION NAME TYPE: FieldType LENGTH SYSID
DRAWING
Table 5-17 DRAWING Read-Only Audit Properties NAME TYPE: Drawing SYSID
5-6
ENTITY
Table 5-18 ENTITY Read-Only Audit Properties ACTIVITY_PERIOD: Duration AVERAGE_INSERTS EXPECTED_ROWS MINIMUM_ROWS SYSID AVERAGE_DELETES AVERAGE_UPDATES MAXIMUM_ROWS NAME TYPE: EntityType
EVENT
Table 5-19 EVENT Read-Only Audit Properties CLASS: NAME TYPE EventClass EVENT_DESCRIPTION SYSID
FIELD
Table 5-20 FIELD Read-Only Audit Properties FRACTION LENGTH MINIMUM PICTURE_CLAUSE SCREEN_LITERAL SHORT_SCREEN_LITERAL TYPE: FieldType IMPLEMENTATION_NAME MAXIMUM NAME REF SCREEN_PICTURE SYSID
FILE
Table 5-21 FILE Read-Only Audit Properties IMPLEMENTATION_NAME SYSID NAME TYPE: FileType
FSDM_SCHEME
Table 5-22 FSDM_SCHEME Read-Only Audit Properties FSDM_SCHEME_DESCRIPTION NAME MUTUALLY_EXCLUSIVE: Boolean SYSID
FSDM_VALUE
Table 5-23 FSDM_VALUE Read-Only Audit Properties FSDM_VALUE_DESCRIPTION SYSID NAME
5-7
FUNCTION
Table 5-24 FUNCTION Read-Only Audit Properties CHILD_MENU: ChildMenu NAME WORKSTATION_GROUP MENU_DESCRIPTION SYSID
HELP
Table 5-25 HELP Read-Only Audit Properties HELP_DESCRIPTION NAME COUNTRY_LANGUAGE: CountryLanguage FORMAT: HelpFmt SYSID SOURCE_FILE
IDENTIFIER
Table 5-26 IDENTIFIER Read-Only Audit Properties NAME TYPE: IdentifierType SYSID
KEY
Table 5-27 KEY Read-Only Audit Properties IMPLEMENTATION_NAME SYSID DELETE_RULE: KeyDeleteRule NAME TYPE: DBtypeKey UNIQUE: Boolean
LOCATION
Table 5-28 LOCATION Read-Only Audit Properties LOCATION_DESCRIPTION SYSID NAME
LOGICAL_PROCESS
Table 5-29 LOGICAL_PROCESS Read-Only Audit Properties LOGICAL_PROCESS_DESCRIPTION NAME TYPE: LogicalProcessType MODE: LogicalProcessMode SYSID
MACHINE
Table 5-30 MACHINE Read-Only Audit Properties GROUP IMPLEMENTATION_NAME
5-8
Table 5-30 MACHINE Read-Only Audit Properties (Continued) NAME OPERATING_SYSTEM_RELEASE OPERATING_SYSTEM: OStype SYSID
ORGANIZATION
Table 5-31 ORGANIZATION Read-Only Audit Properties NAME SYSID
PANEL
Table 5-32 PANEL Read-Only Audit Properties CODEPAGE (525) COUNTRY_LANGUAGE: CountryLanguage (531) SOURCE_FILE PANEL_DESCRIPTION SYSID Y_RESOLUTION BASE: Boolean (531) GUI: GUI (531) COORDINATE_METHOD: CoordSys NAME X_RESOLUTION
PARTITION
Table 5-33 PARTITION Read-Only Audit Properties CELL_RANK IMPLEMENTATION_NAME NAME PLAN_NAME QUALIFIER SYSID DATABASE_SUBSYSTEM LINK_TYPE: SrvLinkType SERVER_OWNER PROTOCOL: Protocol START_TYPE: SrvStartType TYPE: ServerType
PROCESS
Table 5-34 PROCESS Read-Only Audit Properties CHILD_MENU: ChildMenu MENU_DESCRIPTION SYSID EXECUTION_ENVIRONMENT: ProcessEnv NAME WORKSTATION_GROUP
RELATIONSHIP
Table 5-35 RELATIONSHIP Read-Only Audit Properties ACTIVITY_PERIOD: Duration AVERAGE_INSERTS EXPECTED_ROWS MINIMUM_ROWS SYSID AVERAGE_DELETES AVERAGE_UPDATES MAXIMUM_ROWS NAME TYPE: ComplexIndicator
5-9
REPORT
Table 5-36 REPORT Read-Only Audit Properties EXECUTION_ENVIRONMENT: ReportExecEnv LEFT_MARGIN NAME PAGE_SIZE SYSID IMPLEMENTATION_NAME LINE_SIZE ORIENTATION: Orientation PRINTER_TYPE: PrinterType TOP_MARGIN
RULE
Table 5-37 RULE Read-Only Audit Properties DBMS: RuleDBMSUsage EXECUTION_MODE: ExecuteMode ISOLATION_MODE: IsolationMode PACKAGE SOURCE_FILE ENVIRONMENT: RuleExecEnv IMPLEMENTATION_NAME NAME PLAN_NAME SYSID
SECTION
Table 5-38 SECTION Read-Only Audit Properties IMPLEMENTATION_NAME SYSID NAME
SERVER
Table 5-39 SERVER Read-Only Audit Properties COLLECTION_ID ISOLATION_MODE: IsolationMode MINIMUM_TRANSACTION_ID NEXT_TRANSACTION_ID IMPLEMENTATION_NAME MAXIMUM_TRANSACTION_ID NAME
SET
Table 5-40 SET Read-Only Audit Properties FRACTION LENGTH PICTURE STYLE: SetStyle TYPE: SetType IMPLEMENTATION_NAME NAME REPRESENTATION_LENGTH SYSID
5-10
STATE
Table 5-41 STATE Read-Only Audit Properties STATE_DESCRIPTION SYSID NAME TYPE: StateType
SYSTEM
Table 5-42 SYSTEM Read-Only Audit Properties SYSTEM_DESCRIPTION SYSID NAME
TABLE
Table 5-43 TABLE Read-Only Audit Properties ACTIVATION_PERIOD: Duration AVE_INSERTS IMPLEMENTATION_NAME MINIMUM_ROWS SYSID AVE_DELETES CREATOR MAXIMUM_ROWS NAME TYPE: Table_View
TRANSITION
Table 5-44 TRANSITION Read-Only Audit Properties NAME SYSID
VALUE
Table 5-45 VALUE Read-Only Audit Properties IMPLEMENTATION_NAME SYSID NAME
VIEW
Table 5-46 VIEW Read-Only Audit Properties IMPLEMENTATION_NAME SYSID NAME
WINDOW
Table 5-47 WINDOW Read-Only Audit Properties IMPLEMENTATION_NAME SYSID NAME
5-11
WINDOW_CONTENT
Table 5-48 WINDOW_CONTENT Read-Only Audit Properties GUI: GUI SYSID NAME
5-12
ACCESSES
Table 5-50 Domain Values SEQUENCE_NUMBER
APPLICATION_CONFIGURATION_HAS_CONFIGURATION_UNIT
Table 5-51 Domain Values SEQUENCE_NUMBER
BITMAP_HAS_BITMAP_IMPLEMENTATION
Table 5-52 Domain Values SEQUENCE_NUMBER
BUSINESS_OBJECT_OWNS
Table 5-53 Domain Values SEQUENCE_NUMBER
BUSINESS_OBJECT_REFINES_INTO_BUSINESS_OBJECT
Table 5-54 Domain Values SEQUENCE_NUMBER
CELL_CONTAINS
Table 5-55 Domain Values APPLICATION_SERVER_FLAG MACHINE_IMPLEMENTATION_NAME NETWORK_ID COMMUNICATION_GATEWAY_FLAG MANAGER_FLAG SEQUENCE_NUMBER
COMPONENT_USES_COMPONENT
Table 5-56 Domain Values SEQUENCE_NUMBER
5-13
CONFIGURATION_UNIT_ENCAPSULATES
Table 5-57 Domain Values SEQUENCE_NUMBER
CONNECTS_TO
Table 5-58 Domain Values SEQUENCE_NUMBER
CONTAINS_VALUE
Table 5-59 Domain Values SEQUENCE_NUMBER SYMBOL
CONVERSES_WINDOW
Table 5-60 Domain Values SEQUENCE_NUMBER
DATABASE_HAS_TABLE
Table 5-61 Domain Values ACTIVATION_PERIOD: Duration AVE_INSERTS DONE_FLAG: Boolean MAXIMUM_ROWS SEQUENCE_NUMBER AVE_DELETES AVE_UPDATES DO_FLAG: Boolean MINIMUM_ROWS
DATATYPE_IS_COMPOSED_OF_DATATYPE
Table 5-62 Domain Values OCCURS SEQUENCE_NUMBER
DATATYPE_IS_CONSTRAINED_BY_SET
Table 5-63 Domain Values SEQUENCE_NUMBER
5-14
DATA_STORE_IS_REPLACED_BY_ENTITY
Table 5-64 Domain Values COMMENTS SEQUENCE_NUMBER
DEPENDS_ON_LOGICAL_PROCESS
Table 5-65 Domain Values DEPENDS_ON_LOGICAL_PROCESS_DESCRIPTION SEQUENCE_NUMBER
ENTITY_IS_DISTRIBUTED_AT
Table 5-66 Domain Values COMMENTS PARTITIONED: Boolean REPLICATED: Boolean SUBSET: Boolean VARIANT: Boolean MASTER: Boolean REORGANIZED: Boolean SEQUENCE_NUMBER TELEPROC: Boolean
ENTITY_IS_MODIFIED_AT_LOCATION
Table 5-67 Domain Values COMMENTS DELETE: Boolean UPDATE: Boolean CREATE: Boolean READ: Boolean
EVENT_CAUSES
Table 5-68 Domain Values EVENT_CAUSES_DESCRIPTION SEQUENCE_NUMBER
EVENT_HAS_RULE
Table 5-69 Domain Values ACTION_HOST SEQUENCE_NUMBER ACTION_TYPE: ActionType VIEW_MAPPING
EVENT_INFLUENCES_BUSINESS_OBJECT
Table 5-70 Domain Values EVENT_INFLUENCES_BUSINESS_OBJECT_DESCRIPTION SEQUENCE_NUMBER
5-15
EVENT_TRIGGERS
Table 5-71 Domain Values EVENT_TRIGGERS_DESCRIPTION INCLUSIVE_FLAG: InclusiveFlag EXOR_SEQUENCE_NUMBER SEQUENCE_NUMBER
FILE_IS_FORWARDED_TO_FILE
Table 5-72 Domain Values DELETE_RULE SEQUENCE_NUMBER INSERT_RULE UPDATE_RULE
FSDM_SCHEMA_HAS_FSDM_VALUE
Table 5-73 Domain Values SEQUENCE_NUMBER
FSDM_VALUE_CLASSIFIES_FSDM_SCHEMA
Table 5-74 Domain Values SEQUENCE_NUMBER
FUNCTION_INTERSECTS_WITH_ENTITY
Table 5-75 Domain Values COMMENTS DELETE: Boolean SEQUENCE_NUMBER CREATE: Boolean READ: Boolean UPDATE: Boolean
FUNCTION_IS_CARRIED_OUT_AT_LOCATION
Table 5-76 Domain Values COMMENTS MINOR_INV: Boolean MAJOR_INV: Boolean SEQUENCE_NUMBER
HAS_IDENTIFIER
Table 5-77 Domain Values SEQUENCE_NUMBER
HAS_STATE
Table 5-78 Domain Values SEQUENCE_NUMBER
5-16
IDENTIFIER_IS_COMPOSED_OF
Table 5-79 Domain Values SEQUENCE_NUMBER
IMPLEMENTED_BY
Table 5-80 Domain Values
SEQUENCE_NUMBER INITIATES_EVENT
Table 5-81 Domain Values INITIATES_EVENT_DESCRIPTION SEQUENCE_NUMBER
IS_COMPOSED_OF_ATTRIBUTE
Table 5-82 Domain Values OCCURS SEQUENCE_NUMBER
IS_COMPOSED_OF_EVENT
Table 5-83 Domain Values SEQUENCE_NUMBER
IS_COMPOSED_OF_LOGICAL_PROCESS
Table 5-84 Domain Values SEQUENCE_NUMBER
IS_DEFINED_BY
Table 5-85 Domain Values SEQUENCE_NUMBER
IS_DESCRIBED_BY
Table 5-86 Domain Values SEQUENCE_NUMBER OPTIONALITY: Boolean
IS_KEYED_BY
Table 5-87 Domain Values SEQUENCE_NUMBER TYPE: KeyType
5-17
IS_PRECONDITIONED_BY_STATE
Table 5-88 Domain Values IS_PRECONDITIONED_BY_STATE_DESCRIPTION SEQUENCE_NUMBER
IS_RELATED_VIA
Table 5-89 Domain Values ABSTRACT: Boolean CONTROLLING: Boolean MAXIMUM_CARDINALITY OPTIONALITY: Boolean SEQUENCE_NUMBER CARDINALITY: Cardinal DEPENDENT: Boolean MINIMUM_CARDINALITY ROLE
IS_REPLACED_BY
Table 5-90 Domain Values COMMENTS PLANNED: Boolean CURRENT: Boolean SEQUENCE_NUMBER
IS_TYPED_BY
Table 5-91 Domain Values SEQUENCE_NUMBER
KEY_HAS_COLUMN
Table 5-92 Domain Values SEQUENCE_NUMBER
LOGICAL_PROCESS_AFFECTS
Table 5-93 Domain Values COMMENTS DELETES: Boolean SEQUENCE_NUMBER CREATES: Boolean READS: Boolean UPDATES: Boolean
LOGICAL_PROCESS_IMPLEMENTED_BY
Table 5-94 Domain Values SEQUENCE_NUMBER
MACHINE_CAN_ACCESS_MACHINE
Table 5-95 Domain Values SEQUENCE_NUMBER
5-18
ORGANIZATION_SUPPORTS_ENTITY
Table 5-96 Domain Values COMMENTS DELETE: Boolean SEQUENCE_NUMBER CREATE: Boolean READ: Boolean UPDATE: Boolean
ORGANIZATION_SUPPORTS_FUNCTION
Table 5-97 Domain Values COMMENTS MINOR_INVOLVEMENT: Boolean SEQUENCE_NUMBER MAJOR_INVOLVEMENT: Boolean RESPONSIBLE
ORGANIZATION_SUPPORTS_PROCESS
Table 5-98 Domain Values COMMENTS MINOR_INVOLVEMENT: Boolean SEQUENCE_NUMBER MAJOR_INVOLVEMENT: Boolean RESPONSIBLE: Boolean
OWNS_VIEW
Table 5-99 Domain Values SEQUENCE_NUMBER VIEW_USAGE: ViewUsage
PROCESS_DEPENDS_ON_PROCESS
Table 5-100 Domain Values PROCESS_DEPENDS_ON_PROCESS_DESCRIPTION INCLUSIVE_FLAG: InclusiveFlag EXOR_SEQUENCE_NUMBER SEQUENCE_NUMBER
PROCESS_IMPACTS_ENTITY
Table 5-101 Domain Values COMMENTS DELETE: Boolean SEQUENCE_NUMBER CREATE: Boolean READ: Boolean UPDATE: Boolean
PROCESS_IS_CARRIED_OUT_AT_LOCATION
Table 5-102 Domain Values COMMENTS MINOR_INVOLVEMENT: Boolean MAJOR_INVOLVEMENT: Boolean SEQUENCE_NUMBER
5-19
PROCESS_REFINES_INTO_PROCESS
Table 5-103 Domain Values CONDITIONAL_FLAG SEQUENCE_NUMBER
PROCESS_REPLACES_SYSTEM
Table 5-104 Domain Values SEQUENCE_NUMBER
REFERS_TO
Table 5-105 Domain Values SEQUENCE_NUMBER
REFINES_INTO
Table 5-106 SEQUENCE_NUMBER
RELATION_IS_RELATED_VIA_RELATION
Table 5-107 Domain Values SEQUENCE_NUMBER
REPORT_CONTAINS_SECTION
Table 5-108 Domain Values BREAK_FIELD LEFT_MARGIN PRINT_OPTIONS: PrintOpt SEQUENCE_NUMBER BREAK_QUALIFIER PAGE_PLACEMENT: PagePlace SECTION_TYPE: SectionType SEQUENCE_NUMBER_BREAK
RESULTS_IN_STATE
Table 5-109 Domain Values RESULTS_IN_STATE_DESCRIPTION SEQUENCE_NUMBER
RULE_CONVERSES_REPORT
Table 5-110 Domain Values SEQUENCE_NUMBER
5-20
RULE_DEPENDS_ON_RULE
Table 5-111 Domain Values RULE_DEPENDS_ON_RULE_DESCRIPTION INCLUSIVE_FLAG EXOR_SEQUENCE_NUMBER SEQUENCE_NUMBER
RULE_TRIGGERS_EVENT
Table 5-112 Domain Values CONDITION TYPE: RuleTriggerType SEQUENCE_NUMBER VIEW_MAPPING
SERVER_CONTAINS_RULE
Table 5-113 Domain Values ENTRY_TYPE: EntryType SEQUENCE_NUMBER RULE_OBJ_NAME SERVICE_NAME
SERVER_DERIVES_SERVER
Table 5-114 Domain Values SEQUENCE_NUMBER
SYSTEM_AFFECTS_DATA_STORE
Table 5-115 Domain Values COMMENTS DELETE: Boolean SEQUENCE_NUMBER CREATE: Boolean READ: Boolean UPDATE: Boolean
TABLE_HAS_COLUMN
Table 5-116 Domain Values DISTINCT NULL_INDICATOR: Null DISTINCT_TYPE: DistinctType SEQUENCE_NUMBER
TABLE_HAS_KEY
Table 5-117 Domain Values SEQUENCE_NUMBER
TABLE_IS_BASED_ON_TABLE
Table 5-118 Domain Values SEQUENCE_NUMBER
5-21
TABLE_REFERRED_BY_KEY
Table 5-119 Domain Values REFERENTIAL_INTEGRITY: Boolean SEQUENCE_NUMBER
TRIGGERS_LOGICAL_PROCESS
Table 5-120 Domain Values TRIGGERS_LOGICAL_PROCESS_DESCRIPTION SEQUENCE_NUMBER
USES_COMPONENT
Table 5-121 Domain Values SEQUENCE_NUMBER
USES_RULE
Table 5-122 SEQUENCE_NUMBER
VIEW_INCLUDES
Table 5-123 Domain Values NULL_INDICATOR: NullInd SEQUENCE_NUMBER OCCURS
WINDOW_CONTENT_HAS_HELP
Table 5-124 Domain Values SEQUENCE_NUMBER
WINDOW_CONTENT_HAS_PANEL
Table 5-125 Domain Values SEQUENCE_NUMBER
WINDOW_HAS_BITMAP531
Table 5-126 Domain Values SEQUENCE_NUMBER
WINDOW_HAS_WINDOW_CONTENT
Table 5-127 Domain Values SEQUENCE_NUMBER
5-22
Property Domains
Property Domains
A property can have a set of values called a domain. Table 5-128 is a list of all the domains and the values of each domain listed alphabetically.
Table 5-128 Property Domains ActionType AttributeType BMPFormatType BmpType Boolean BusinessObjectType Cardinal ChildMenu CollectNature CompDBMSUsage CompExecEnv ComplexIndicator CountryLanguage531 CoordSys DBtypeKey DistinctType Drawing Duration EntityType EntryType ExecuteMode ExecutionMode FieldType FileType GUI HelpFmt531 IdentifierType Inclus_Flag IsolationMode KeyDeleteRule531 KeyType Language LogicalProcessMode LogicalProcessType Null NullInd OStype Orientation PagePlace PrinterType ProcessEnv Protocol ReportExecEnv RuleDBMSUsage RuleExecEnv RuleTriggerType SectionType ServerType SetStyle SetType SrvLinkType SrvStartType StateType Table_View ViewUsage
ActionType
Table 5-129 Domain Values CLIENT_ASYNC SERVER_NON_TRANSACTION SERVER_TRANSACTION CLIENT_POPUP SERVER_ASYNC
5-23
Property Domains
AttributeType
Table 5-130 Domain Values DERIVED FUNDAMENTAL
BMPFormatType
Table 5-131 Domain Values BITMAP
BmpType
Table 5-132 Domain Values BITMAP ICON
Boolean
Table 5-133 Domain Values FALSE TRUE
BusinessObjectType
Table 5-134 Domain Values REFERENTIAL TRANSACTIONAL
Cardinal
Table 5-135 Domain Values MANY UNKNOWN ONE
ChildMenu
Table 5-136 Domain Values MENU_BAR PULL_DOWN NO_MENU
CollectNature
Table 5-137 Domain Values LOGICAL RELATIONAL PHYSICAL
5-24
Property Domains
CompDBMSUsage
Table 5-138 Domain Values DB2 NOT_APPLICABLE DLI
CompExecEnv
Table 5-139 Domain Values CICS IMS PC PC_USER CICS_BATCH MVS_BATCH PC_SYSTEM STRATUS
ComplexIndicator
Table 5-140 Domain Values AND REGULAR XOR IOR SUBTYPE
CountryLanguage531
Table 5-141 Domain Values US_ENGLISH UK_ENGLISH
CoordSys
Table 5-142 Domain Values CHARACTER PIXEL
DBtypeKey
Table 5-143 Domain Values FOREIGN PRIMARY INDEX
DistinctType
Table 5-144 Domain Values ABSOLUTE RATIO
5-25
Property Domains
Drawing
Table 5-145 Domain Values DATABASE_DESIGN ENTITY_RELATIONSHIP ENTITY_VS_LOCATION_2 FUNCTION_VS_LOCATION ORGANIZATION_VS_ENTITY PROCESS_DEPENDENCY STATE_TRANSITION SYSTEM_VS_PROCESS DATA_STORE_VS_ENTITY ENTITY_VS_LOCATION_1 FUNCTION_VS_ENTITY MATRIX ORGANIZATION_VS_PROCESS PROCESS_VS_ENTITY SYSTEM_VS_DATA_STORE WINDOW_FLOW
5-26
Property Domains
Duration
Table 5-146 Domain Values DAY QUARTER YEAR MONTH WEEK
EntityType
Table 5-147 Domain Values ASSOCIATIVE INTERSECTION CHARACTERISTIC KERNEL
EntryType
Table 5-148 Domain Values PRIVATE PUBLIC
ExecuteMode
Table 5-149 Domain Values ASYNCHRONOUS SYNCHRONOUS
ExecutionMode
Table 5-150 Domain Values HAS_SUBROUTINE NO_SUBROUTINE
FieldType
Table 5-151 Domain Values CHARACTER DECIMAL IMAGE MIXED_CHARACTER TEXT TIMESTAMP DATE GRAPHIC_CHARACTER INTEGER PICTURE TIME VARCHAR
5-27
Property Domains
FileType
Table 5-152 Domain Values DB2
GUI
Table 5-153 Domain Values 3270 OS2_PM PWS_GENERIC OPEN_LOOK OSF_MOTIF WINDOWS
HelpFmt531
Table 5-154 Domain Values IPF HPS RTF
IdentifierType
Table 5-155 Domain Values ALTERNATE PRIMARY CANDIDATE
Inclus_Flag
Table 5-156 Domain Values EXCLUSIVE REGULAR INCLUSIVE
IsolationMode
Table 5-157 Domain Values GET XDR-GET SET XDR-SET
KeyDeleteRule531
Table 5-158 Domain Values CASCADE RESTRICT NULL
5-28
Property Domains
KeyType
Table 5-159 Domain Values DELETE_KEY UPDATE_KEY
Language
Table 5-160 Domain Values ASSEMBLER COBOL C PLI
LogicalProcessMode
Table 5-161 Domain Values ACTION DECISION
LogicalProcessType
Table 5-162 Domain Values ASSOCIATE CAPTURE RETRIEVE VALIDATE CALCULATE DELETE UPDATE
Null
Table 5-163 Domain Values NOT_NULLS_WITH_DEFAULT NULLS_NOT_ALLOWED NULLS_ALLOWED
NullInd
Table 5-164 Domain Values NOT_NULLS_WITH_DEFAULT NULLS_NOT_ALLOWED NULLS_ALLOWED
OStype
Table 5-165 Domain Values AIX CICS_MVS HPUX OS/400 SUN_OS WINDOWS_NT CICS_6000 CICS_OS2 mainframe OS2 WINDOWS WIN_OS2
5-29
Property Domains
Orientation
Table 5-166 Domain Values LANDSCAPE PORTRAIT
PagePlace
Table 5-167 Domain Values END_PAGE LAST_PAGE SAME_PAGE FIRST_PAGE NEXT_PAGE WHOLE_PAGE
PrinterType
Table 5-168 Domain Values 3800 GENERIC
ProcessEnv
Table 5-169 Domain Values CICS PC PC_AND_SYSTEM_88 SYSTEM_88 NOT_APPLICABLE PC_AND_CICS PC_SYSTEM_88_AND_CICS SYSTEM_88_AND_CICS
Protocol
Table 5-170 Domain Values LU2 NAMED_PIPES NOVELL_SPX UDP LU62 NETBIOS TCPIP
ReportExecEnv
Table 5-171 Domain Values BATCH CICS_BATCH CICS
RuleDBMSUsage
Table 5-172 Domain Values DB2 N/A
5-30
Property Domains
RuleExecEnv
Table 5-173 Domain Values CICS IMS LANDP_SERVER PC PC_AND_IMS CICS_AND_BATCH LANDP_FUNCTION MVS_BATCH PC_AND_CICS STRATUS
RuleTriggerType
Table 5-174 Domain Values POST PRE
SectionType
Table 5-175 Domain Values BREAK HEADER FOOTER REGULAR
ServerType
Table 5-176 Domain Values CICS ENCINA IMS ONC DCE HPS LANDP TUXEDO
SetStyle
Table 5-177 Domain Values DEFINE LOOKUP ERROR VALUES
SetType
Table 5-178 Domain Values CHARACTER GRAPHIC_CHAR MIXED_CHAR DECIMAL INTEGER
SrvLinkType
Table 5-179 Domain Values DYNAMIC STATIC
5-31
Property Domains
SrvStartType
Table 5-180 Domain Values AUTOSTART FORKING
StateType
Table 5-181 Domain Values FINAL INTERMEDIATE INITIAL
Table_View
Table 5-182 Domain Values TABLE VIEW
ViewUsage
Table 5-183 Domain Values ALTERNATE DATA INPUT OUTPUT WORK CANDIDATE FOREIGN INPUT/OUTPUT PRIMARY
5-32
CHAPTER
Windows Controls provides instructions for coding window blocks and supplies the reference data to complete the window control definitions in Chapter 4, TurboCycler Template Language. Controls are the visual elements in a window that an end user can interact with. Window Statement Control Types Window Control Properties Property Types and Property Values Window Properties Matrix The TurboCycler template language lets you design a window by creating controls and arranging them in a window. In addition to controls, a window can have a menu bar with pull-down menus.
Creating Controls
When you create a control with a MAKE statement, you also set its properties. Controls generally require positioning properties such as LEFT, BOTTOM, WIDTH, and HEIGHT. Any property not explicitly set defaults to settings similar to those in Window Painter. Specify colors by either of two methods. The first is to set the RGB color value explicitly; the other is to set a property to a color listed under colortype. The first example uses the three RGB colors: MAKE STATIC_TEXT HAVING [ HPSID = ID_TEXT_1, BGCOLOR_RED = 255, BGCOLOR_GREEN = 0, BGCOLOR_BLUE = 0 ] ENDMAKE The second example uses an explicit color type definition that produces the same result. MAKE STATIC_TEXT HAVING [ HPSID = ID_TEXT_2, BGCOLOR = RED ] ENDMAKE
6-1
However, you cannot use both methods to set the same color property. For example, you can set a controls background color with the three RGB properties BGCOLOR_RED, BGCOLOR_GREEN, and BGCOLOR_BLUE. Or you can set it with the single colortype property BGCOLOR. You must establish a relationship between a SPREADSHEET and its CELLs. First, create your spreadsheet with a MAKE statement, and then associate each of its cells with the spreadsheet through the CONTAIN statement, as shown next. MAKE SPREADSHEET Spreadsheet HAVING [BOTTOM = 40, LEFT = 20, HEIGHT = 155, WIDTH = 200, HPSID = ID_SPREADSHEET ] LINKED TO MyDataView ENDMAKE CONTAIN CELL IN Spreadsheet HAVING [WIDTH = CellWidth, HEIGHT = 22, HPSID = (QUERY NAME OF MyDataFields(I)), CONTROL_TEXT = (QUERY SCREEN_LITERAL OF MyDataFields(I)), IMMEDIATE_RETURN = TRUE ] LINKED TO MyDataFields(I) ENDCONTAIN You need the same relationship for LB_COLUMN (which must be in a LISTBOX) and CHART_X_AXIS and CHART_Y_AXIS (which must be in a CHART_WINDOW). Finally when TABSTOP is TRUE, the tabbing order for controls is the same order as they are created in the window block. The following pages list the window statements control types and their properties. Also see Table 6-42 on page 6-26 for a summary of all the control types and properties.
6-2
Table 6-1
TurboCycler Window Controls (Continued) PROTECTED_EDIT_FIELD PUSH_BUTTON RADIO_BUTTON RECTANGLE SPREADSHEET STATIC_TEXT
BITMAP
A special type of static control that displays a bitmap from a file. It cannot be linked to a repository object. Its properties are:
Table 6-2 BOTTOM HEIGHT LEFT WIDTH BITMAP Control Properties FILE HPSID VISIBLE
CELL
Represents a column in a SPREADSHEET, and as such is not a visual control. The linked-to field must be in a multiply-occurring logical view. A CELL can be created only by a CONTAIN statement. Its properties are:
Table 6-3 CELL Properties FIELD_TEXT HEADER_BOTTOM HPSID JUSTIFICATION MAXIMUM PICTURE WIDTH
CHART_WINDOW
Displays data graphically in one of 13 different formats. End users cannot tab to a chart. The CHART_WINDOW must be linked to a multiply-occurring view. Data to be displayed is specified by creating CHART_X_AXIS and CHART_Y_AXIS controls using the CONTAIN statement. A window can contain no more than ten CHART_WINDOW controls. Its properties are:
Table 6-4 BOTTOM FOOTING FOOTING_COLOR_RED CHART_WINDOW Properties CHART_TYPE FOOTING_COLOR FOOTING_COLOR_GREEN
6-3
Table 6-4
CHART_WINDOW Properties (Continued) HEADING HEADING_COLOR_RED HEADING_COLOR_BLUE HPSID LEFTLABEL LEFTLABEL_COLOR_RED LEFTLABEL_COLOR_GREEN MINIMIZE RIGHTLABEL RIGHTLABEL_COLOR_RED RIGHTLABEL_COLOR_BLUE WIDTH
FOOTING_COLOR_BLUE HEADING_COLOR HEADING_COLOR_GREEN HEIGHT LEFT LEFTLABEL_COLOR LEFTLABEL_COLOR_BLUE MAXIMIZE RESIZE RIGHTLABEL_COLOR RIGHTLABEL_COLOR_GREEN CONTROL_TEXT
CHART_X_AXIS
Represents an x-axis variable in a CHART_WINDOW, and thus is not really a visual control. This control must be created with the CONTAIN statement. The linked-to field must be in a multiply-occurring view and can be of any type. Only one CHART_X_AXIS control is created per CHART_WINDOW. Its property is:
Table 6-5 HPSID CHART_X_AXIS Properties
CHART_Y_AXIS
Represents a y-axis variable in a CHART_WINDOW, and thus is not really a visual control. This control must be created with the CONTAIN statement. The linked-to field must be in a multiply-occurring view and must be of numeric type. A CHART_WINDOW can contain up to eight CHART_Y_AXIS controls. Its properties are;
Table 6-6 HPSID CHART_y_AXIS Properties LEGEND
CHECKBOX
A toggle switch you can use when its setting is independent of any other control. The linked-to field type is character, and its length must be one. You can specify a mnemonic key with the CONTROL_TEXT property. Its properties are:
Table 6-7 BDCOLOR BDCOLOR_GREEN BGCOLOR BGCOLOR_GREEN CONTROL_TEXT Properties BDCOLOR_RED BDCOLOR_BLUE BGCOLOR_RED BGCOLOR_BLUE
6-4
CONTROL_TEXT Properties (Continued) FGCOLOR FGCOLOR_GREEN FONT HEIGHT IMMEDIATE_RETURN TABSTOP VISIBLE
DROPDOWN_COMBOBOX
Combines an EDIT_FIELD and a LISTBOX. The user can enter a value in the control or select a value from a scrollable list. The linked-to field must have its Reference Table Name attribute set to the System ID of the online validation set associated with the field entity in the hierarchy. Its properties are:
Table 6-8 BDCOLOR BDCOLOR_GREEN BGCOLOR BGCOLOR_GREEN BOTTOM FGCOLOR_RED FGCOLOR_BLUE FONT HEIGHT IMMEDIATE_RETURN MANDATORY VISIBLE DROPDOWN_COMBOBOX Properties BDCOLOR_RED BDCOLOR_BLUE BGCOLOR_RED BGCOLOR_BLUE FGCOLOR FGCOLOR_GREEN FILE GROUPSTART HPSID LEFT TABSTOP WIDTH
DROPDOWN_LISTBOX
Behaves like the DROPDOWN_COMBOBOX except that the user can enter values only from the set referenced by the Reference Table Name attribute of the linked-to field. Its properties are:
Table 6-9 BDCOLOR BDCOLOR_GREEN BGCOLOR BGCOLOR_GREEN BOTTOM FGCOLOR_RED FGCOLOR_BLUE FONT DROPDOWN_LISTBOX Properties BDCOLOR_RED BDCOLOR_BLUE BGCOLOR_RED BGCOLOR_BLUE FGCOLOR FGCOLOR_GREEN FILE GROUPSTART
6-5
EDIT_FIELD
Defines an entry field in which the end user can enter and edit data associated with the linked-to field, which can be a single occurrence field of any type except TIMESTAMP. Its properties are:
Table 6-10 EDIT_FIELD Properties BDCOLOR BDCOLOR_GREEN BGCOLOR BGCOLOR_GREEN BOTTOM FGCOLOR FGCOLOR_GREEN FONT HEIGHT IMMEDIATE_RETURN LEFT MAXIMUM PICTURE VISIBLE BDCOLOR_RED BDCOLOR_BLUE BGCOLOR_RED BGCOLOR_BLUE CHARFORMAT FGCOLOR_RED FGCOLOR_BLUE GROUPSTART HPSID JUSTIFICATION MANDATORY MINIMUM TABSTOP WIDTH
ELLIPSE
A special type of static control that displays a filled ellipse in the window. It cannot be linked to a repository object. Its properties are:
Table 6-11 ELLIPSE Properties BLUE COLOR HEIGHT LEFT WIDTH BOTTOM GREEN HPSID RED
FILE_EDITOR
Allows end users to view, but not edit, the contents of a text file. The linked-to field must be of type character or variable character and must contain the complete path name of the file to display at run time. Its properties are:
6-6
Table 6-12 FILE_EDITOR Properties BDCOLOR BDCOLOR_GREEN BGCOLOR BGCOLOR_GREEN BOTTOM FGCOLOR_RED FGCOLOR_BLUE GROUPSTART HPSID TABSTOP WIDTH BDCOLOR_RED BDCOLOR_BLUE BGCOLOR_RED BGCOLOR_BLUE FGCOLOR FGCOLOR_GREEN FONT HEIGHT LEFT VISIBLE WORDWRAP
GROUPBOX
Associates related controls, usually RADIO_BUTTONs. Within the group, the end user can use the arrow keys rather than Tab to navigate among controls. A GROUPBOX cannot be linked to a repository object. Its properties are:
Table 6-13 GROUPBOX Properties BOTTOM FGCOLOR FGCOLOR_GREEN FONT HPSID VISIBLE CONTROL_TEXT FGCOLOR_RED FGCOLOR_BLUE HEIGHT LEFT WIDTH
HOTSPOT
Behaves like a PUSH_BUTTON but is not displayed at run time. Usually a HOTSPOT is positioned behind a BITMAP to create what appears to end users as a bitmap push button. Like a PUSH_BUTTON, a HOTSPOT cannot be linked to a repository object. Its properties are:
Table 6-14 HOTSPOT Properties BOTTOM HPSID WIDTH HEIGHT LEFT
LB_COLUMN
Represents a column in a LISTBOX, and thus is not really a visual control. The linked-to field must be in a multiply-occurring logical view. You must create one LB_COLUMN for each LISTBOX using the CONTAIN statement. Its properties are:
6-7
LISTBOX
Displays a list of choices in a vertically scrolling window. A LISTBOX is linked to a multiply-occurring view. The field entity is specified by creating a LB_COLUMN in a CONTAIN statement. Its properties are:
Table 6-16 LISTBOX Properties AUTO_CALL BDCOLOR_RED BDCOLOR_BLUE BGCOLOR_RED BGCOLOR_BLUE FGCOLOR FGCOLOR_GREEN FONT HEIGHT IMMEDIATE_RETURN SELECT_MODE VISIBLE BDCOLOR BDCOLOR_GREEN BGCOLOR BGCOLOR_GREEN BOTTOM FGCOLOR_RED FGCOLOR_BLUE GROUPSTART HPSID LEFT TABSTOP WIDTH
MULTILINE_EDIT
Defines an entry field in which the user can enter text on multiple lines. The linked-to field must be of the type character or variable character. Its properties are:
Table 6-17 MULTILINE_EDIT Properties BDCOLOR BDCOLOR_GREEN BGCOLOR BGCOLOR_GREEN BOTTOM FGCOLOR_RED FGCOLOR_BLUE GROUPSTART HPSID LEFT READ_ONLY VISIBLE WORDWRAP BDCOLOR_RED BDCOLOR_BLUE BGCOLOR_RED BGCOLOR_BLUE FGCOLOR FGCOLOR_GREEN FONT HEIGHT IMMEDIATE_RETURN MANDATORY TABSTOP WIDTH
6-8
PROTECTED_EDIT_FIELD
Behaves like an EDIT_FIELD except that the end user cannot edit the displayed data. Its properties are:
Table 6-18 PROTECTED_EDIT_FIELD Properties BDCOLOR BDCOLOR_GREEN BGCOLOR BGCOLOR_GREEN BOTTOM FGCOLOR FGCOLOR_GREEN FONT HEIGHT IMMEDIATE_RETURN LEFT MINIMUM TABSTOP WIDTH BDCOLOR_RED BDCOLOR_BLUE BGCOLOR_RED BGCOLOR_BLUE CHARFORMAT FGCOLOR_RED FGCOLOR_BLUE GROUPSTART HPSID JUSTIFICATION MAXIMUM PICTURE VISIBLE
PUSH_BUTTON
Usually completes an end users interaction with the window. When the end user selects a PUSH_BUTTON, its HPSID is returned to the invoking rule. You cannot link a PUSH_BUTTON to a repository object. There are two methods used to associate push buttons with shortcut keys: Specify the key as an ASCII character using the ASCII_KEY property Use the function keys listed under the funckeytype property domain with the FUNC_KEY property. You cannot mix the methods. Do not specify the same button with both methods. However, you can use one method for one button and the other method for a different button. You can also set the MODIFIER property to require that the Ctrl, Alt, or Shift key be pressed simultaneously with the ASCII_KEY or FUNC_KEY property. For Window Painter compatibility, you must set MODIFIER to CTRL if the shortcut is an ASCII_KEY. You can use only one modifier, so, for example, attempting to combine the Ctrl+Tab keys is an error. You can specify a PUSH_BUTTON mnemonic by the CONTROL_TEXT property. The PUSH_BUTTON properties are listed in Table 6-19.
Table 6-19 PUSH_BUTTON Properties ASCII_KEY BDCOLOR BDCOLOR_BLUE BDCOLOR_GREEN BDCOLOR_RED FGCOLOR_GREEN FGCOLOR_RED FONT FUNC_KEY GROUPSTART
6-9
Table 6-19 PUSH_BUTTON Properties (Continued) BGCOLOR BGCOLOR_BLUE BGCOLOR_GREEN BGCOLOR_RED BOTTOM CONTROL_TEXT FGCOLOR FGCOLOR_BLUE HEIGHT HPSID LEFT MODIFIER TABSTOP VISIBLE WIDTH
RADIO_BUTTON
A toggle switch that indicates one of a mutually exclusive set of choices. The linked-to field has type character and a length sufficient to hold the longest HPSID of the RADIO_BUTTONs in the group. You can specify a mnemonic key with the CONTROL_TEXT property. Its properties are listed in Table 6-20.
Table 6-20 RADIO_BUTTON Properties BDCOLOR BDCOLOR_BLUE BDCOLOR_GREEN BDCOLOR_RED BGCOLOR BGCOLOR_BLUE BGCOLOR_GREEN BGCOLOR_RED BOTTOM CONTROL_TEXT FGCOLOR FGCOLOR_BLUE FGCOLOR_GREEN FGCOLOR_RED FONT GROUPSTART HEIGHT HPSID IMMEDIATE_RETURN LEFT TABSTOP VISIBLE WIDTH
RECTANGLE
A special type of static control that displays a filled rectangle on the window. It cannot be linked to a repository object. Its properties are listed in Table 6-21.
Table 6-21 RECTANGLE Properties BLUE BOTTOM COLOR GREEN HEIGHT HPSID LEFT RED WIDTH
6-10
SPREADSHEET
Contains columns that represent linked fields and rows that represent each field occurrence. The end user can edit cells thus formed. The SPREADSHEET must be linked to a multiply-occurring logical view. Specify the fields displayed in each column by creating a CELL control using the CONTAIN statement for each field. This control only supports the following fonts: SYSTEMFONT8, SWISS8, ROMAN8, MODERN8, MODERN10, and MODERN12. Its properties are listed in Table 6-22.
Table 6-22 SPREADSHEET Properties AUTO_CALL AUTO_SELECT BDCOLOR BDCOLOR_BLUE BDCOLOR_GREEN BDCOLOR_RED BGCOLOR BGCOLOR_BLUE BGCOLOR_GREEN BGCOLOR_RED BOTTOM CELL_HEIGHT DRAW_LINES FGCOLOR FGCOLOR_BLUE FGCOLOR_GREEN FGCOLOR_RED FONT GROUPSTART HEADER_HEIGHT HEADER_HPSID HEIGHT HPSID LEFT NUMBERING_RECORD ROW_SELECT SCROLL_LOCK SELECT_MODE TABSTOP VISIBLE WIDTH
STATIC_TEXT
Displays labels or instructions. A STATIC_TEXT cannot be linked to a repository object. Its properties are listed in Table 6-23.
Table 6-23 STATIC_TEXT Properties BDCOLOR BDCOLOR_BLUE BDCOLOR_GREEN BDCOLOR_RED BGCOLOR BGCOLOR_BLUE BGCOLOR_GREEN BGCOLOR_RED BOTTOM CONTROL_TEXT FGCOLOR FGCOLOR_BLUE FGCOLOR_GREEN FGCOLOR_RED FONT HEIGHT HPSID LEFT VISIBLE WIDTH
6-11
A
ASCII_KEY string
Specifies an ASCII character to be used as the shortcut key for a control. If you specify ASCII_KEY, set MODIFIER to CTRL. (Refer to MODIFIER on page 6-19 and FUNC_KEY on page 6-16.)
AUTO_CALL
boolean
If AUTO_CALL is TRUE for a LISTBOX or SPREADSHEET, control returns to the invoking rule when the end user tries to scroll beyond the first or last occurrence defined in the view data structure associated with the list box. The rule can then retrieve more data. Set AUTO_CALL only if you do not use the component SET_VIRTUAL_LISTBOX_SIZE described in the AppBuilder documentation for your system.
AUTO_SELECT
boolean
If AUTO_SELECT is TRUE, the end user can select an item in a SPREADSHEET by putting the cursor on it. Any selected item is deselected. If AUTO_SELECT is FALSE, the end user can move the cursor without changing the selection. AUTO_SELECT does not apply when SELECT_MODE is set to MULTIPLE. (See SELECT_MODE on page 6-22.)
B
BDCOLOR colortype
Sets the border color of the control to one of the colors listed for colortype.
6-12
BDCOLOR_RED
integer
Sets the border color RGB red value. Assign an integer value between 0 and 255.
BDCOLOR_GREEN
integer
Sets the border color RGB green value. Assign an integer value between 0 and 255.
BDCOLOR_BLUE
integer
Sets the border color RGB blue value. Assign an integer value between 0 and 255.
BGCOLOR
colortype
Sets the background color of the control to one of the colors listed for colortype.
BGCOLOR_RED
integer
Sets the background color RGB red value. Assign an integer value between 0 and 255.
BGCOLOR_GREEN
integer
Sets the background color RGB green value. Assign an integer value between 0 and 255.
BGCOLOR_BLUE
integer
Sets the background color RGB blue value. Assign an integer value between 0 and 255.
BLUE
integer
Sets the control color RGB blue value. Assign an integer value between 0 and 255.
BOTTOM
integer
C-D-E
CELL_HEIGHT
Sets the vertical size of a CELL in a SPREADSHEET.
integer
6-13
CHARFORMAT
Sets the case of text in the control.
charformattype
CHART_TYPE
charttype
Sets the type of chart displayed in a CHART_WINDOW control to one to the types listed under charttype.
CHECK_MANDATORY_FIELDS
boolean
If TRUE, all controls that have their MANDATORY property set to TRUE must contain valid entries when the end user selects the PUSH_BUTTON. If a control does not contain a valid entry, a message box is displayed and the first control containing an invalid entry receives the input focus. (See MANDATORY on page 6-18.)
COLOR
colortype
Sets the control color to one of the colors listed for colortype.
CONTROL_TEXT
string
Specifies the label that appears on CELL, CHART_WINDOW, CHECKBOX, GROUPBOX, PUSH_BUTTON, RADIO_BUTTON, or STATIC_TEXT controls. To define a mnemonic key, precede the character with an ampersand (&) or a tilde (~).
DRAW_LINES
drawlinestype
Determines whether a SPREADSHEET is displayed with horizontal and vertical lines, horizontal lines only, vertical lines only, or no lines at all.
F
FGCOLOR colortype
Sets the foreground color of the control to one of the colors listed for colortype.
FGCOLOR_RED
integer
Sets the foreground color RGB red value. Assign an integer value between 0 and 255.
FGCOLOR_GREEN
integer
Sets the foreground color RGB green value. Assign an integer value between 0 and 255.
6-14
FGCOLOR_BLUE
integer
Sets the foreground color RGB blue value. Assign an integer value between 0 and 255.
FIELD_TEXT
string
If the FIELD_TYPE property of a CELL were CONTROL_TEXT, specifies the text to be displayed. If the FIELD_TYPE is not CONTROL_TEXT, do not set this property.
FIELD_TYPE
fieldtype
Specifies the type of field displayed in a CELL: text, edit, or protected edit.
FILE
string
For a BITMAP, identifies the bit map file associated with the control; for a DROPDOWN_COMBOBOX, specifies the Reference Table Name of the field entity linked to the DROPDOWN_COMBOBOX with a .REF extension. The Reference Table Name attribute should be the system ID of the online validation set associated with the field entity in the hierarchy.
FONT
fonttype
Sets the font of labels and input text. Use the default font where possible to make the windows device independent. Not all controls support all fonts. Note that selecting a font can cause the HEIGHT property to be ignored for EDIT_FIELD, PROTECTED_EDIT_FIELD, RADIO_BUTTON, and CHECKBOX controls.
FOOTING
string
FOOTING_COLOR
colortype
FOOTING_COLOR_RED
integer
Sets the RGB color red value of the FOOTING text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
FOOTING_COLOR_GREEN
integer
Sets the RGB color green value of the FOOTING text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
6-15
FOOTING_COLOR_BLUE
integer
Sets the RGB color blue value of the FOOTING text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
FUNC_KEY
funckeytype
Sets the function key to be used as a shortcut key for the control. (See ASCII_KEY on page 6-12.)
G-H
GREEN integer
Sets the control color RGB green value. Assign an integer value in the range of 0 to 255.
GROUPSTART
boolean
If TRUE, specifies that the control starts a group. Do not set this property for other controls in the group. Create all controls in the group in sequence so that the tab order will be correct.
HEADER_BOTTOM
integer
HEADER_HEIGHT
integer
HEADER_HPSID
string
Specifies the HPSID for static text in a multicolumn list box header.
HEADING
Sets heading text displayed in a CHART_WINDOW.
string
HEADING_COLOR
colortype
6-16
HEADING_COLOR_RED
integer
Sets the RGB color red value of the HEADING text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
HEADING_COLOR_GREEN
integer
Sets the RGB color green value of the HEADING text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
HEADING_COLOR_BLUE
integer
Sets the RGB color blue value of the HEADING text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
HEIGHT
Sets the vertical size of the control.
integer
HPSID
string
Contains the text that uniquely identifies the control to the system. Every HPSID must be unique for the generated application to work correctly at run time.
I-J-K-L
IMMEDIATE_RETURN boolean
If TRUE, returns control to the invoking rule when the end user navigates away from the control. For a read-only control, double-clicking on the control returns program control to the invoking rule.
JUSTIFICATION
justificationtype
Causes control text to be right justified, left justified, or centered. This property applies to all the field types: text, numeric, date, and time.
LEFT
Sets the horizontal position of the control.
integer
LEFTLABEL
string
6-17
LEFTLABEL_COLOR
colortype
LEFTLABEL_COLOR_RED
integer
Sets the RGB color red value of the LEFTLABEL text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
LEFTLABEL_COLOR_GREEN
integer
Sets the RGB color green value of the LEFTLABEL text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
LEFTLABEL_COLOR_BLUE
integer
Sets the RGB color blue value of the LEFTLABEL text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
LEGEND
string
M-N-O
MANDATORY boolean
If TRUE, requires that the control contain valid input when the end user selects a PUSH_BUTTON having CHECK_MANDATORY_FIELDS set to TRUE. (See CHECK_MANDATORY_FIELDS on page 6-14.)
MAXIMIZE
boolean
MAXIMUM
Sets the maximum value allowed for numeric fields.
decimal
MINIMIZE
boolean
6-18
MINIMUM
Sets the minimum value allowed for numeric fields.
decimal
MODIFIER
modifiertype
Specifies that the Ctrl, Alt, or Shift keys must be pressed with a FUNC_KEY or ASCII_KEY to activate a shortcut key for a control. You can use only one modifier. For a ASCII_KEY, set the MODIFIER to CTRL. (See ASCII_KEY on page 6-12 and FUNC_KEY on page 6-16.)
NUMBERING_RECORD
boolean
When TRUE, the rows of a SPREADSHEET control are numbered on the left side of the control.
PICTURE
string
Sets the display format of fields. The string consists of literal text and format specifiers that control the appearance of date, time, and numeric fields, as shown in Table 6-25 through Table 6-29. For the date and time fields, the picture can combine literal text with the specifiers, as shown in Table 6-26 and Table 6-28.
Table 6-25 Date Specifiers Specifier %c %D %d %j %M %m %W %Y %y Description Century Day of the month, with suffix Day of the month Julian day Month of the year, text Month of the year Day of the week, text Year Years since 1900
Table 6-26 Standard Date Formats Date %m/%d/%y %0m/%0d/%0y %m-%d %m-%y %0c%0y%0m%0d %W, %M %D, %Y Today is %W. %d/%m/%y %0d/%0m/%y %d-%m Example 1/5/95 01/05/95 1-5 1-95 19950105 Thursday, January 5th, 1995 Today is Thursday 1/5/95 01/05/95 5-1
6-19
For time fields, the picture can contain literal text alone and in combination with the specifiers, as shown in Table 6-27 and Table 6-28.
Table 6-27 Time Format Specifiers Specifier %H %h %M %m %s %t %x Description Hour, text (24-hour clock) Hour (12-hour clock) Minutes, text Minutes Seconds Hour (24-hour clock) AM/PM indicator
Table 6-28 Standard Time Formats Time display picture %0h:%0m:%0s %x %0h:%0m:%0s %h-%m-%s %x %t-%m-%s %h %x %H %M Time is %H The time is %h-%m-%s %x. Example 01:22:03 PM 13:22:03 1-22-3 PM 13-22-3 1 PM Thirteen Twenty_Two Time is Thirteen The time is 1-22-3 PM.
For numeric fields, valid replacement characters are: 9 . , $ Z * S + - cr db, as shown in Table 6-29. The country setting determines the replacement of the characters: . , $ S.
Table 6-29 Numeric and Replacement Characters Character 9 . , $ Z * S + cr db Description Numeric character Decimal separator Thousands separator Currency symbol Suppress leading zeroes Pad left with asterisks Sign character Sign character, printed only if positive Sign character, printed only if negative Credit symbol, printed only if negative Debit symbol, printed only if negative
6-20
R
READ_ONLY boolean
If TRUE, the end user cannot change the text in the control.
RED
integer
Sets the control color RGB red value. Assign an integer value between 0 and 255.
RESIZE
boolean
If TRUE, end users can grab the border of a CHART_WINDOW to resize the chart.
RIGHTLABEL
string
RIGHTLABEL_COLOR
colortype
RIGHTLABEL_COLOR_RED
integer
Sets the RGB color red value of the RIGHTLABEL text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
RIGHTLABEL_COLOR_GREEN
integer
Sets the RGB color green value of the RIGHTLABEL text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
RIGHTLABEL_COLOR_BLUE
integer
Sets the RGB color blue value of the RIGHTLABEL text displayed in a CHART_WINDOW. Assign an integer value between 0 and 255.
ROW_SELECT
boolean
If TRUE, the end user can select an entire row in a SPREADSHEET by clicking a cell in a row. Otherwise, only the clicked-on cell is selected.
6-21
S through Z
SCROLL_LOCK boolean
If TRUE, the end user can tab to the next row in a SPREADSHEET when reaching the end of the current row; also, the end user must press Ctrl+Tab to shift the input focus to the next control in the window. If FALSE, the end users tabbing at the end of a row shifts the input focus to the next control in the window.
SELECT_MODE
selectmodetype
Specifies in a SPREADSHEET whether the end user can select only one item (SINGLE), zero or more items (MULTIPLE), or one or more items (EXTENDED).
TABSTOP
boolean
If TRUE, the end user can tab to the control. The order that you specify objects in the window block determines the tabbing order of window controls in the completed window.
VISIBLE
If TRUE, the control is visible to the end user.
boolean
WIDTH
integer
Sets the horizontal width of the control. For a CELL, this is the width of the column in the SPREADSHEET.
WORDWRAP
boolean
If TRUE, automatically wraps text displayed in a MULTILINE_EDIT to a new line, based on the size of the control. If FALSE, the end user must scroll horizontally to see hidden text.
6-22
boolean
Table 6-31 boolean Property Types FALSE NO TRUE YES 0 false no true yes 1
charformattype
Table 6-32 charformattype Property Types ALLFIRSTUPPER LOWER FIRSTUPPER UPPER
charttype
Table 6-33 charttype Property Types AREACHART2D BARCHART2D BARLINECHART2D CANDLE2D COLUMNCHART3D LINECHART2D PERBARCHART3D PIECHART3D SMOOTHLINECHART2D STACKEDBARCHART2D AREACHART3D BARCHART3D BARLINECHART3D COLUMNCHART2D HILOCLOSE2D LINECHART3D PIECHART2D POINTANDFIG2D SCATTERCHART2D STACKEDBARCHART3D
6-23
colortype
Table 6-34 colortype Property Types BLACK BROWN DARK_BLUE DARK_GRAY DARK_MAGENTA DARK_YELLOW GREEN PINK WHITE BLUE CYAN DARK_CYAN DARK_GREEN DARK_RED GRAY MAGENTA RED YELLOW
drawlinestype
Table 6-35 drawslinestype Properties HLINES VHLINES NOLINES VLINES
fieldtype
Table 6-36 fieldtype Properties EDIT CONTROL_TEXT PROTECTED
fonttype
Table 6-37 fonttype Properties MODERN8 MODERN12 ROMAN10 ROMAN14 ROMAN24 SWISS10 SWISS14 SWISS24 MODERN10 ROMAN8 ROMAN12 ROMAN18 SWISS8 SWISS12 SWISS18 SYSTEMFONT8
6-24
funckeytype
Table 6-38 funckeytype Properties F1 F3 F5 F7 F9 F11 F2 F4 F6 F8 F10 F12
justificationtype
Table 6-39 justificationtype Properties CENTER RIGHT LEFT
modifiertype
Table 6-40 modifiertype Properties ALT SHIFT CTRL
6-25
selectmodetype
Table 6-41 EXTENDED SINGLE MULTIPLE
Properties AUTO_CALL AUTO_SELECT BDCOLOR BDCOLOR_RED BDCOLOR_GREEN BDCOLOR_BLUE BGCOLOR BGCOLOR_RED BGCOLOR_GREEN BGCOLOR_BLUE BLUE BOTTOM CELL_HEIGHT CHARFORMAT CHART_TYPE CHECK_MANDATORY_FIELDS COLOR DRAW_LINES FGCOLOR FGCOLOR_RED FGCOLOR_GREEN FGCOLOR_BLUE FIELD_TEXT FIELD_TYPE FILE x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
x x
x x x x
x x x x
x x x x
x x x x
x x x x
x x x x
x x x x
x x x x
x x x x x x
6-26
Table 6-42 Window Properties (Continued) Controls: STATIC_TEXT SPREADSHEET RECTANGLE RADIO_BUTTON PUSH_BUTTON PROTECTED_EDIT_FIELD MULTILINE_EDIT LISTBOX LB_COLUMN HOTSPOT GROUPBOX FILE_EDITOR ELLIPSE EDIT_FIELD DROPDOWN_LISTBOX DROPDOWN_COMBOBOX CHECKBOX CHART_Y_AXIS CHART_X_AXIS CHART_WINDOW CELL BITMAP
Properties FONT FOOTING FOOTING_COLOR FOOTING_COLOR_RED FOOTING_COLOR_GREEN FOOTING_COLOR_BLUE FUNC_KEY GREEN GROUPSTART HEADER_BOTTOM HEADER_HEIGHT HEADER_HPSID HEADING HEADING_COLOR HEADING_COLOR_RED HEADING_COLOR_GREEN HEADING_COLOR_BLUE HEIGHT HPSID IMMEDIATE_RETURN JUSTIFICATION ASCII_KEY LEFT LEFTLABEL LEFTLABEL_COLOR LEFTLABEL_COLOR_RED LEFTLABEL_COLOR_GREEN LEFTLABEL_COLOR_BLUE LEGEND MANDATORY MAXIMIZE MAXIMUM MINIMIZE MINIMUM MODIFIER NUMBERING_RECORD x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
x x x x x x
x x x x x x x x x x
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
x x x x x x x
x x
x x
6-27
Table 6-42 Window Properties (Continued) Controls: STATIC_TEXT SPREADSHEET RECTANGLE RADIO_BUTTON PUSH_BUTTON PROTECTED_EDIT_FIELD MULTILINE_EDIT LISTBOX LB_COLUMN HOTSPOT GROUPBOX FILE_EDITOR ELLIPSE EDIT_FIELD DROPDOWN_LISTBOX DROPDOWN_COMBOBOX CHECKBOX CHART_Y_AXIS CHART_X_AXIS CHART_WINDOW CELL BITMAP
Properties PICTURE READ_ONLY RED RESIZE RIGHTLABEL RIGHTLABEL_COLOR RIGHTLABEL_COLOR_RED RIGHTLABEL_COLOR_GREEN RIGHTLABEL_COLOR_BLUE ROW_SELECT SCROLL_LOCK SELECT_MODE TABSTOP CONTROL_TEXT VISIBLE WIDTH WORDWRAP x x x x x x x x x x x x x x x x x x x
x x
x x x x x x x
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
6-28
Index
INDEX
AppBuilder 2.1.0 Scripting Tools Reference Guide
A
Attribute Object 1-19 Audit Properties universal 5-4 Workgroup Repository 5-3 AUDIT_PROPERTIES 5-4
Dialog Window using TCDIALOG variable 4-20 Dialogs and Controls specifying size and position 4-17 Dictionary Object 1-21 drawing file 1-20 Drawing Objects 1-10
B
Blocks additional 4-16
E
Entity List 5-4 entity relationship diagram (ERD) 2-5, 2-15 Entity Relationship Diagrammer symbols 4-46 escape sequences 4-44 executing the application 2-20 expression conditional 4-31 integer 4-34 list 4-36 object 4-38 object in hierarchy diagram 4-42 string 4-43 supporting 4-28 expressions 4-28
C
CHILD 4-42 ChildScript Object 1-8 CoCtrl Object 1-17 CoDraw Object 1-10 color values (TurboScripter) 1-15 COMPONENT Block 4-16 Component_Folder 1-22 Construction Workbench 1-1 controls creating on a dialog 4-18 CoPanel Object 1-11 country values (TurboScripter) 1-14 CRUD Rules template 2-6
F
FIELD 4-8 Field and View Rename template 2-11 FLATFILE Block 4-16 flow diagram reading 4-2 flow diagrams defined 4-1 forward engineering 2-5, 2-16 Functions 4-48 Get and File 4-48 String Manipulation 4-50 Superseded 4-52 functions (template language) 4-48
D
database diagram (DBD) 2-5 Database Diagrammer symbols 4-46 declaring local variables 4-21 default templates 2-4 Detail Display Rule and Window sample 4-55 Detail Display rule/window sample 4-52 Developer Kit (SDK) 3-1 DIALOG Block 4-17 Dialog Controls processing 4-21 setting properties 4-19
G
generating the application 2-4
Generation Template 3-1 GetChildren 1-21 GetParents 1-21 GUI Rules/Windows template 2-8
P
preparing the application 2-19 procedure callable blocks 4-21 procedures (template language) 4-21 Process Dependency Diagrammer symbols 4-47 processing symbols 4-45 Property Domains 5-23 Property Object, see Attribute Object 1-19 Property Types 6-23 Property Values 6-23
H
HIERARCHY Block 4-6 Hierarchy Block double arrow 4-7 Hierarchy Cloner template 2-11, 2-12 hierarchy diagram (HD) 2-5 Host Object 1-8
I
initialization file settings 2-13
R
registry setting trace output 1-7 Registry settings 1-22 Relationship Types listed with properties 5-12 Rename Verify template 2-11 Repo Object 1-2 RULE 4-8 RULE Block 4-9
J
JScript 1-1, 1-20
K
Key 1-21 Key, Item pair 1-21 KEYWORDS Block 4-17
S
screen literals 2-18 scripting engine 1-9 Select Generation Templates window 2-4 SEQUENCE= 4-8 specifying output (TurboCycler) 2-3 SQL Delete Rule sample 4-52, 4-53 starting TurboCycler 2-1 State Transition Diagrammer symbols 4-46 statement APPEND and REMOVE 4-25 CALL 4-23 CALL SERVICE 4-24 common 4-29 SELECT 4-24 SET 4-28 SHOWMESSAGE 4-27 supporting 4-28 template language sample 5-2 TRAVERSE 4-25 UPDATE MESSAGE 4-27 statements for use in applications 4-23 symbols processing on open drawings 4-45 symbols (template language) 4-2 syntax conventions (template language) 4-2 syntax of template language 4-1
L
language flows (template language) 4-28 LENGTH= 4-8
M
making a callable procedure 4-21
O
object Attribute 1-19 ChildScript 1-8 CoCtrl 1-17 CoDraw 1-10 CoPanel 1-11 Host 1-8 Repo 1-2 Trace 1-7 TSEnt 1-4 TSRel 1-6 TurboHost 1-9 Object Type query sample 5-1 Object Types listed with properties 5-3 OLE Automation 1-11 open drawing 4-45 OWNS_VIEW 4-8, 4-42
Index
ii
T
table window controls and properties 6-26 TCDIALOG using the variable to set properties 4-20 template samples 4-52 Template Block features 4-21 template language 4-1 functions 4-48 language flows 4-28 procedures 4-21 statements 4-3 symbols 4-2 syntax conventions 4-2 window control 6-1 template statements 4-3 template, default CRUD Rules 2-6 Field and View Rename 2-11 GUI Rules/Windows 2-8 Hierarchy Cloner 2-11, 2-12 Rename Verify 2-11 Utilities 2-10 templates creating 3-1 customizing 3-2 migrating from OS/2 4-18 TEXT Block 4-17 top level objects 1-10 trace file 1-7, 1-22 trace level 1-7 Trace Object 1-7 transforming (the database diagram) 2-5, 2-17 TSATL library 1-21 TSEnt Object 1-4 TSRel Object 1-6 TURBO.INI settings 2-13 TurboCycler specifying output 2-3 starting 2-1 TurboHost Object 1-9
TurboScript object Attribute 1-19 ChildScript 1-8 CoCtrl 1-17 CoDraw 1-10 CoPanel 1-11 Host 1-8 Repo 1-2 Trace 1-7 TSEnt 1-4 TSRel 1-6 TurboHost 1-9 TurboScripter, defined 1-1 TYPE= 4-8
U
USAGE= 4-8 USAGES Block 4-5 USE ANY Block 4-17 Utilities template 2-10
V
variables declaring from any block 4-21 VBScript 1-1, 1-20 VIA RELATION 4-8 VIA RELATIONSHIP 4-42 VIEW 4-8, 4-42 VIEW_INCLUDES 4-8
W
window properties 6-26 WINDOW Block 4-12 Window Block Property Types 6-23 window control (template language) 6-1 Window Controls properties 6-12 types 6-2 window controls 6-2 Window Flow Diagrammer symbols 4-47 Window Painter 1-14 window properties 6-2 Windows Controls 6-1 WITH 4-42
Index
iii