0% found this document useful (0 votes)
61 views

Quick Start Dexterity

Uploaded by

Henry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

Quick Start Dexterity

Uploaded by

Henry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 124

Microsoft Dexterity

Quick Start
Release 12
Copyright Copyright © 2014 Microsoft Corporation. All rights reserved.

Limitation of liability This document is provided “as-is”. Information and views expressed in this document, including
URL and other Internet Web site references, may change without notice. You bear the risk of using
it.

Some examples depicted herein are provided for illustration only and are fictitious. No real
association or connection is intended or should be inferred.

Intellectual property This document does not provide you with any legal rights to any intellectual property in any
Microsoft product.

You may copy and use this document for your internal, reference purposes.

Trademarks Microsoft, Dexterity, Microsoft Dynamics, Visual Basic and Windows are trademarks of the
Microsoft group of companies. FairCom and c-tree Plus are trademarks of FairCom Corporation and
are registered in the United States and other countries.

All other trademarks are property of their respective owners.

Warranty disclaimer Microsoft Corporation disclaims any warranty regarding the sample code contained in this
documentation, including the warranties of merchantability and fitness for a particular purpose.

License agreement Use of this product is covered by a license agreement provided with the software product. If you
have any questions, please call the Microsoft Dynamics GP Customer Assistance Department at
800-456-0025 (in the U.S. or Canada) or +1-701-281-6500.

Publication date June 2014


Contents
Introduction ................................................................................................................................. 2
What’s in this manual .................................................................................................................. 2
Finding information ..................................................................................................................... 2
Prerequisites .................................................................................................................................. 4
Symbols and conventions............................................................................................................ 5
Product support ............................................................................................................................ 6

Part 1: Tour of the Sample Application ................................................. 8


Chapter 1: Overview of the Sample Application .................................... 9
Viewing the sample application dictionary .............................................................................. 9
Inventory application components .......................................................................................... 11

Chapter 2: Working with the Sample Application .............................. 13


Understanding the Inventory application .............................................................................. 13
Using the Inventory application............................................................................................... 13
What to do next........................................................................................................................... 18

Part 2: Lessons .................................................................................................................... 20


Chapter 3: Creating Dictionaries ........................................................................ 21
Lesson: Creating a new dictionary ........................................................................................... 22
What to do next........................................................................................................................... 23

Chapter 4: Creating Data Types ........................................................................... 25


Lesson: Creating data types ...................................................................................................... 26

Chapter 5: Creating Formats .................................................................................. 33


Lesson: Creating formats ........................................................................................................... 34

Chapter 6: Creating Fields ........................................................................................ 37


Lesson: Creating fields ............................................................................................................... 38

Chapter 7: Creating Tables ....................................................................................... 41


Lesson: Creating tables .............................................................................................................. 44

QUICK START i
C O N T E N T S

Chapter 8: Creating Forms ........................................................................................ 47


The Main Menu form................................................................................................................. 48
Lesson: Creating forms.............................................................................................................. 49

Chapter 9: Creating Windows ................................................................................ 51


Lesson: Creating windows........................................................................................................ 52

Chapter 10: Adding Scripts ...................................................................................... 65


Lesson: Adding scripts .............................................................................................................. 66

Chapter 11: Creating a Lookup ............................................................................. 85


Lesson: Creating a Lookup ....................................................................................................... 86

Chapter 12: Creating Menus .................................................................................... 97


Lesson: Creating menus ............................................................................................................ 98

Chapter 13: Creating a Report ............................................................................ 103


Lesson: Creating a Report ....................................................................................................... 104
What to do next ......................................................................................................................... 111

Glossary ...................................................................................................................................... 113

Index ................................................................................................................................................ 117

ii Q U I C K S T A R T
INTRODUCTION
Introduction
Welcome to Microsoft® Dexterity, a powerful application development
system. Designed to create Microsoft Dynamics™ GP, Dexterity is ideal for
creating transaction-based business applications, such as accounting and
business management products. If you use Dexterity to create applications
that integrate with other products like Microsoft Dynamics GP, Dexterity
allows you to add to the power of the core applications with solutions fitted
to the needs of your customers.

Before you put Dexterity to work for you, take a few moments to review the
information presented here. It explains the organization of this manual and
provides you with information about the rest of the Dexterity
documentation.

What’s in this manual


The Quick Start manual is a hands-on learning tool to help you understand
how to use the Dexterity system. Even if you’ve used other development
systems before, we recommend using this manual as a foundation for
understanding application development with Dexterity.

• Part 1, Tour of the Sample Application, introduces you to the


Inventory application, which you can install by selecting the Sample
Applications component when you install Dexterity.

• Part 2, Lessons, shows you how to use Dexterity to create the Inventory
application, and explains the portions of the Dexterity interface that
you’ll encounter while creating the application.

Finding information
We’ve provided a number of tools to help you understand Dexterity and
locate information about the development environment. These tools
include sample applications, online help files, manuals designed to address
specific needs, and a comprehensive index to help you find information
anywhere in the Dexterity documentation.

2 Q U I C K S T A R T
I N T R O D U C T IO N

Manual organization
The Dexterity documentation is divided into several manuals. An overview
of the manuals is shown in the following illustration:

Quick
Start

Dexterity Function
SanScript Dexterity
Programmer’s Library
Reference Utilities
Guide Reference

Integration Guide Stand-alone


Application Guide

Comprehensive
Index

Start with the Quick Start manual. Once you’ve become familiar with the
Dexterity development environment, you’ll use the Dexterity
Programmer’s Guide, SanScript Reference, Function Library Reference and
Dexterity Utilities manuals. If you’re creating a stand-alone application,
refer to the Stand-alone Application Guide; if you’re creating an application
that integrates with Microsoft Dynamics GP, refer to the Integration Guide.
A brief description of each manual follows.

• The Dexterity Quick Start manual contains overview information and


lessons to introduce you to the process of creating applications with
Dexterity.

• The Dexterity Programmer’s Guide is divided into two volumes. Vol-


ume 1 contains information about the Dexterity development system, a
detailed explanation of the resources used to create applications, infor-
mation about managing application development, and instructions
about packaging applications.

Volume 2 contains information about adding scripts to a Dexterity


application, describes how to work with controls and tables, and
describes advanced scripting tools

QUICK START 3
I N T R O D U C T I O N

• The SanScript Reference contains information about the Dexterity


script language, sanScript.

• The Function Library Reference describes the various libraries of


functions available to use in your applications.

• The Dexterity Utilities manual contains information on how to use


Dexterity Utilities and instructions that can help you perform dictio-
nary maintenance tasks.

• The Dexterity Stand-alone Application Guide contains information


about creating a stand-alone application. Topics covered include devel-
oping pathname support, online help, security, and using tools such as
the Report Writer or Modifier.

• The Integration Guide contains information about interface and pro-


gramming conventions used for Microsoft Dynamics GP, and describes
how to create an integrating application.

• The Comprehensive Index contains the combined index of all the


Dexterity manuals. Use this when you are searching for a specific topic,
but don’t know in which manual you should look.

Prerequisites
Although the information in the Dexterity manuals will help you use the
Dexterity system, an understanding of basic programming concepts and
database design is also important.

• A cursory understanding of an application development environment


such as Microsoft’s Visual Basic® is helpful. Knowledge of third-gener-
ation programming languages, such as C or Pascal, is also helpful.

• If you’re developing applications that operate over a network, a thor-


ough understanding of your network environment is useful.

• If you’re developing applications that will function in a client/server


environment, a knowledge of your client/server database architecture
is recommended.

4 Q U I C K S T A R T
I N T R O D U C T IO N

Symbols and conventions


To help you use the Dexterity documentation more effectively, we’ve used
the following symbols and conventions within the text to make specific
types of information stand out.

Symbol Description
➥ of table Items; A continuation character indicates that a script
continued from one line to the next should be
typed as one line in the Script Editor.
The light bulb symbol indicates helpful tips,
shortcuts and suggestions.

Warnings indicate situations you should be


aware of when completing tasks with Dexterity.

The mouse symbol indicates information to


guide you to the appropriate location in
Dexterity.

Margin notes summa- Margin notes call attention to critical


rize important informa- information, and direct you to other areas of the
tion. documentation where a topic is explained.
The SQL symbol indicates information that
SQL
applies only when a SQL database type is used.

Convention Description
Part 2, Lessons Bold type indicates a part name.
Chapter 6, “Creating Quotation marks indicate a chapter name.
Fields”
Applying formats Italicized type indicates a section name.
set 'l_Item' to 1; This font is used to indicate script examples.
RUNTIME.EXE Words in uppercase indicate a file name.
Software Development Acronyms are spelled out the first time they’re
Kit (SDK) used.
TAB or ALT+M Small capital letters indicate a key or a key
sequence.

QUICK START 5
I N T R O D U C T I O N

Product support
Dexterity technical support can be accessed using the following methods.

• Telephone support – Technical Support can be reached at (888) 477-


7877 between 8:00 a.m. and 5:00 p.m. Central Time, Monday through
Friday. International users can contact Technical Support at (701) 281-
0555.

• Internet – Technical Support is also available online through Customer-


Source or PartnerSource, and is accessible from www.microsoft.com/
businesssolutions.

6 Q U I C K S T A R T
PART 1: TOUR OF THE SAMPLE APPLICATION
Part 1: Tour of the Sample
Application
Use this portion of the manual to become familiar with the Inventory
sample application. The information is divided into the following chapters:

• Chapter 1, “Overview of the Sample Application,” describes the com-


ponents that make up the Inventory application.

• Chapter 2, “Working with the Sample Application,” describes how to


use the Inventory application to add an item to the database, retrieve
that item, and print a report.

Once you’ve become familiar with the Inventory application’s design and
usage, continue to Part 2, Lessons, to learn how to create the Inventory
application.

8 Q U I C K S T A R T
Chapter 1: Overview of the Sample
Application
Use this chapter to become familiar with the Inventory sample application.
To install this and other sample applications, be sure the Sample
Applications component is selected when you install Dexterity.

The Inventory application provides you with valuable information about


how resources interact to create a functional application. Part 2, Lessons,
will take you through the steps to re-create this application dictionary. This
chapter includes information about the following:

• Viewing the sample application dictionary


• Inventory application components

Viewing the sample application dictionary


To view the Inventory dictionary, complete the following steps.

1. Launch Dexterity.
Double-click the Dexterity icon. Dexterity will open and a dialog box
will appear, as shown in the following illustration.

Click this lookup


button to select a
dictionary to open.

QUICK START 9
PA RT 1 T O U R O F T HE S AM P L E AP P LI C AT I O N

2. Open the Sample application folder.


Mark the option to open an existing dictionary, then click the lookup
button next to the Dictionary Name field. In the file dialog that appears,
double-click the Samples folder. The dialog box should be similar to the
following illustration.

3. Open the INVENT.DIC dictionary.


Select the INVENT.DIC dictionary, and click Open. The path to the
dictionary will appear in the Dictionary Name field. Click OK to pen
the dictionary. The Dexterity tool bar and Resource Explorer window
will appear.

Using tools mode and test mode


Choose Test Mode Throughout this tour, we discuss the components of the sample application
from the Debug menu as they appear at runtime. To view these components as we discuss them,
to change between switch Dexterity from tools mode to test mode. Tools mode, which is
tools mode and test Dexterity’s default mode, allows you to use Dexterity to create or edit
mode. resources in a dictionary. Test mode allows you to view the application as it
appears at runtime. To change modes, choose Test Mode from the Debug
menu.

10 Q U I C K S T A R T
C H A P T E R 1 O V E R V IE W O F TH E S A M P LE A P PL IC A T IO N

Inventory application components


The sample application dictionary provides an example of a basic inventory
tracking system. Many of the standard tasks you’ll use to create your own
applications, such as saving item information to a table or displaying items
in a scrolling window, have been included in this dictionary. The following
illustration shows how the sample application appears when all its forms
are displayed in test mode.

The sample Inventory


application uses three
forms to track items from
the Inventory Data table.

The sample application is composed of the following resources:

• A single table named Inventory Data. Tables store information and


organize data into logical groupings.

• Three forms named Main Menu, Inventory_Maintenance and


Inventory_Lookup. Each contains a single window. Unlike the
windows they contain, forms don’t appear in your application at
runtime. They’re used to organize other resources, such as windows
and menus, that function together in your application.

• A single report named Inventory Report. This report displays a detailed


list of items in the Inventory Data table.

In the next chapter you’ll learn to use the sample Inventory application.
Before continuing, be sure you are in Dexterity tools mode.

QUICK START 11
12 Q U I C K S T A R T
Chapter 2: Working with the Sample
Application
Use the information in this chapter to become familiar with the sample
Inventory application. Once you are familiar with the application, you’ll be
ready to re-create the application using Dexterity.

This chapter includes information about the following:

• Understanding the Inventory application


• Using the Inventory application
• What to do next

Understanding the Inventory application


The Inventory application is used to track the cost, selling price and
availability, or status, of items in inventory. Sample data is also installed
with this sample application, so that data will appear when you run the
application’s report, or view data in the Inventory Data table using the
Inventory Lookup window.

The Inventory application is created as a stand-alone application. Stand-


alone applications are applications that do not integrate with other
products like Microsoft Dynamics GP.

Using the Inventory application


If you’re continuing from the previous chapter, the INVENT.DIC dictionary
should be open and Dexterity should be in tools mode. If not, open the
INVENT.DIC dictionary using the directions provided in Chapter 1,
“Overview of the Sample Application.” Then, follow these steps to use the
Inventory application.

1. Enter test mode.


Choose Test Mode from the Debug menu. The first form that appears is
called the main menu form. All stand-alone applications created using
Dexterity must have a form named “Main Menu” for the runtime
engine to properly interpret the application dictionary.

If you create applications that integrate with the another product, you don’t
need to create a main menu form. Forms and windows in your application will
use the main menu form from the main application.

QUICK START 13
PA RT 1 T O U R O F T HE S AM P L E AP P LI C AT I O N

The following illustration shows how the main menu window from the
sample application dictionary will appear.

Dexterity automatically
draws native window
elements.

2. Enter a new item record.


Enter new items using the Inventory Maintenance window. To display
this window, click the Inventory button. When displayed, the window
should look like the following illustration.

Use this list box to set the


item’s status.
Click this button to
display the Inventory
Lookup window.

Prompts accompany
each field to describe the
field’s contents.

Enter information about These push buttons allow


an item in these fields. you to store or remove
data from the table, or
clear the window.

14 Q U I C K S T A R T
C H A P T E R 2 W O R K I N G W IT H T H E S A M P L E A P P L I C A T I O N

The Inventory Maintenance window uses several fields from the


Inventory Data table to indicate specific information about an item.
Fields in this window allow you to specify a part number, a description,
the cost of the item and the price at which the item will be sold. To
create a new record, enter the following information:

Part Number 01102


Description Sledge Hammer
Cost 13.00
Selling Price 18.95
Status In Stock

When all the information is entered in the window, click Save. The Save
button stores the information displayed in the window as a separate
record in the Inventory Data table. The Delete button will remove a
record from the table. The Clear button will clear the contents of the
window without affecting the table or existing records.

3. Update an existing item record.


Click the Lookup button next to the Part Number field to display the
Inventory Lookup window. This window displays records currently in
the Inventory Data table. The following illustration shows how the
window should appear.

The newly added record


appears as a line in the
lookup scrolling window.
The part number and
description for each record
currently in the Inventory
Data table are displayed.

This window displays each record as a single line in the scrolling


window. Highlighting a line and clicking the Select button will display
detailed information about it in the Inventory Maintenance window.

QUICK START 15
PA RT 1 T O U R O F T HE S AM P L E AP P LI C AT I O N

Complete the following steps to display information about an existing


item in the Inventory Maintenance window:

Select 01-100, 16 oz. Hammer


Click Select

The Inventory Maintenance window will appear, displaying detailed


information about the item. To allow users to change the selling price of
items quickly and easily, this form uses menu selections that set the
selling price of an item based upon a percentage of the item’s cost.
Complete the following steps to change the selling price:

Move to the Selling Price field


Choose 10% from the Markup menu

Note that the selling price changes from $7.80 to $7.15. The original
selling price was set at the cost plus 20%, so lowering the percentage
lowered the selling price. The window should look like the following
illustration.

Click Save. The changes you made to this item will be saved and the
record will be updated in the Inventory Data table.

4. Print the Inventory Report.


A single report is defined in this sample application dictionary. It
displays a detailed list of the items in the Inventory Data table. With the
Inventory Maintenance window displayed, choose Print from the File
menu. When the Report Destination window appears, indicate the
destination of the report by following these steps:

Select Screen as the destination


Click OK

16 Q U I C K S T A R T
C H A P T E R 2 W O R K I N G W IT H T H E S A M P L E A P P L I C A T I O N

The Screen Output window will appear. After a few moments, the
report will appear on your screen and should look like the following:

The report shows the


new record for the
sledge hammer, and the
new selling price of the
16-ounce hammer.

To close the Screen Output window, click the window close box.

5. Delete an item record.


Delete items using the Item Maintenance window. Display the record
for the item you wish to delete, either by selecting that record from the
Inventory Lookup window, or by typing the item’s part number and
pressing TAB to leave the Part Number field. Complete the following
steps to delete the item you added in step 2:

Enter 01102 in the Part Number field


tab to the Description field
Click the Delete button

A warning dialog box will appear to verify that you wish to delete the
selected record. The warning dialog box will look similar to the
following illustration.

Click Delete to delete the record. The Inventory Maintenance window will
reappear. When you’ve finished exploring the sample Inventory
application, quit Dexterity by choosing Exit from the File menu.

QUICK START 17
PA RT 1 T O U R O F T HE S AM P L E AP P LI C AT I O N

What to do next
Continue to Part 2, Lessons, to create the Inventory application dictionary
step by step. As you review the rest of the information in this manual, use
the completed sample application dictionary to help you understand new
concepts associated with developing your own applications using
Dexterity.

While you are working with the lessons in this manual, use the information
in the Volumes 1 and 2 of the Dexterity Programmer’s Guide, as well as the
SanScript Reference manual to learn more about the resources used to
create the sample application.

18 Q U I C K S T A R T
PART 2: LESSONS
Part 2: Lessons
This part of the manual walks you through creating the sample Inventory
application. Each chapter contains a detailed, step-by-step lesson you can
refer to when creating your own applications.

Each lesson builds upon the previous one as you create the Inventory
application from the bottom to top, starting with data types and moving on
to formats, fields, tables, forms and windows. Therefore, it’s important that
you go through the lessons in the order they are presented.

Following is a list of the chapters included in this part, and a brief


explanation of each:

• Chapter 3, “Creating Dictionaries,” describes dictionaries and how to


create the Inventory application’s dictionary.

• Chapter 4, “Creating Data Types,” describes data types and how to


create them.

• Chapter 5, “Creating Formats,” introduces formats and how to use


them with certain data types.

• Chapter 6, “Creating Fields,” explains how to create fields for the


Inventory application.

• Chapter 7, “Creating Tables,” explains how to create the table and key
used in the Inventory application.

• Chapter 8, “Creating Forms,” explains what forms are and how to cre-
ate and use them in an application.

• Chapter 9, “Creating Windows,” describes how to create the windows,


including a main menu, for an application.

• Chapter 10, “Adding Scripts,” introduces the Dexterity scripting


language, sanScript, and the role of scripts in an application.

• Chapter 11, “Creating a Lookup,” describes a scrolling window and its


usefulness as a lookup window.

• Chapter 12, “Creating Menus,” explains how to create form-specific


menus.

• Chapter 13, “Creating a Report,” explains how to use the Dexterity


Report Writer to create the Inventory Report.

20 Q U I C K S T A R T
Chapter 3: Creating Dictionaries
An application dictionary (a file with the extension .DIC) is the main file that
stores all the unique attributes of your application. When you use Dexterity
to create new windows, tables, reports and fields, you are creating
resources that are stored in the application dictionary.

Chapter 1, “Overview of the Sample Application,” described how to open


an existing application dictionary. This chapter will explain how to create a
new application dictionary.

QUICK START 21
PA RT 2 L E S S O N S

Lesson: Creating a new dictionary


This lesson shows you how to create the dictionary for the Inventory
application. Before you begin, be sure you have installed Dexterity.

Double-click the Dexterity icon to launch Dexterity. Dexterity will open and
the dialog box used to open existing dictionaries or create new dictionaries
will appear.

In this dialog box, mark the option to create a new dictionary that contains a
Main Menu form. Click the lookup button next to the Dictionary Name
field to open a file dialog. This dialog box includes a field in which you can
enter the name of the new dictionary.

The following illustration shows this dialog.

22 Q U I C K S T A R T
C H A P T E R 3 C R E A T I N G D I C T I O N A R I E S

The directory in which Dexterity is installed will appear as the default.


Select the directory where you want to store the dictionary.

Be sure to place this dictionary in a folder other than the one containing the sample
Inventory application you installed with Dexterity.

Enter INVENT.DIC as the name for this dictionary, and click Save. The
name and location of the new dictionary will appear in the Dictionary
Name field. Click OK. The application dictionary will be created at the
location you specified in the dialog box. Once the Dexterity toolbar and
Resource Explorer window appear, you’ll be ready to begin creating
resources for the application.

What to do next
You’ve just created the dictionary that will store all the resources for the
Inventory application. At this point, the Dexterity tool bar should be
showing and the dictionary name, INVENT.DIC, should be displayed in the
window title bar.

This is the window that each of the following lessons assumes you are starting
from. Each lesson will also return you to this position.

Continue on to the next chapter where you’ll begin creating resources for
the Inventory application, starting with data types.

QUICK START 23
24 Q U I C K S T A R T
Chapter 4: Creating Data Types
The initial step in creating applications with Dexterity is to build a
database. You start with the data types your application will use.

Data types define a Data types specify the characteristics of fields in your application. Without
field’s ability to store, a data type, a field doesn’t have the ability to store, control or display
control or display information. In this respect, most of a field’s functionality is based on the
information. data type it uses, including the field’s data storage capabilities in a table
and its display characteristics when added to a window.

You’ll need to create a total of seven data types for the Inventory
application. First, you’ll need four data types for the four different kinds of
data stored by the Inventory application (part numbers, item descriptions,
prices and a supply status). You’ll also need to create data types for the
three push buttons (Save, Clear and Delete).

QUICK START 25
PA RT 2 L E S S O N S

Lesson: Creating data types


This lesson will lead you through creating each data type, and provide you
with basic information about the windows used to create them.

After starting Dexterity and opening the Inventory dictionary, be sure the
Resource Explorer window is displayed. If it isn’t, click the Open Resource
Explorer button on the Dexterity toolbar to open it.

The left pane in the Resource Explorer lists the various types of resources
that can be part of a dictionary. Several types of resources are combined into
a category called “Base”. Data types are in the base category. Select the Base
category in the left pane of the Resource Explorer. Click the plus sign to
expand the Base group. Notice that the third item displayed is Data Types.

Select the Data Types item. The right pane of the Resource Explorer will
display any data types that have been created for the dictionary. Since no
data types have been created yet, the list will be empty.

Click the New button to


create a new data type.

Select Data Types in the


Base group.

To create a new data type, click the New button in the Resource Explorer
toolbar. The Data Type Definition window will appear.

26 Q U I C K S T A R T
C H A P T E R 4 C R EA T IN G DA TA T Y P E S

You are now ready to enter the data types for the fields that will be used to
store data. To create the data type to be used by the Part Number field,
follow these steps:

1. Enter Part_Number_String5 in the Data Type Name field.

2. Select String from the Control Type drop-down list.

3. Enter 5 in the Keyable Length field. When you enter the keyable length
and press TAB to leave the field, the Storage Size field will be filled in
automatically.

When you’ve entered this information, the Data Type Definition window
should look like the following illustration.

Understanding what you’ve done


Before you save this data type and create another, let’s review the
information you’ve just entered.

The name used for this data type, Part_Number_String5, readily identifies
this as the data type to be used for the Part Number field we’ll create in
Chapter 6. It also clearly identifies the control type and keyable length of
the data type.

By selecting String as the control type, you’ve specified the function of the
data type and how it will store and display data. By specifying 5 as the
keyable length, you limited the number of characters a user can type in a
field using this data type. Once you did that, Dexterity automatically
assigned the number of bytes needed to store fields using the data type.

QUICK START 27
PA RT 2 L E S S O N S

The control type is the defining characteristic of a data type. Dexterity has
over 20 control types; the most common are listed in the following table.

Control type Use Example


Check box Allows a user to check or uncheck
a particular option.
Currency Displays or stores a currency
value.
Date Displays or stores a date value.

Integer Displays or stores a numeric value


between -32,768 and 32,767.
List box Allows a user to choose one item
from a list of items.

Long integer Displays or stores a numeric value


between -2,147,483,648 and
2,147,483,647.
Push button Initiates an action.

Radio button Provides at least two choices, only


one of which can be selected at
any instance. Always used with a
radio group.

String Displays or stores a text value up


to 255 characters in length.
Time Displays or stores a time value.

28 Q U I C K S T A R T
C H A P T E R 4 C R EA T IN G DA TA T Y P E S

Creating the remaining data types


Create the data type for Now you’re ready to save the data type you’ve created and create the
the Description field. remaining data types. Click Add to save the data type and leave the Data
Type Definition window open.

Using the same procedure, create the data type for the Description field. For
this data type, enter the following information:

Data Type Name String30


Control Type String
Keyable Length 30

When you’ve finished, click Add.

Create the data type for For the data type for the Cost and Selling Price fields, enter the following:
the Cost and Selling
Price fields. Data Type Name Currency7
Control Type Currency
Keyable Length 10

The currency field will allow users to enter values up to 7 digits in length,
such as $99,999.99. However, to create a currency field that allows 7 digits to
be entered, you must set the keyable length to 10. This is because Dexterity
always reserves five digits to the right of the decimal separator for currency
amounts even if the last three digits won’t be displayed. To have seven
usable digits, three extra digits are needed for a total of ten. When you’ve
finished entering the data, click Add.

Create the data type for Next, create the data type for the Status field. Enter the following without
the Status field. clicking Add:

Data Type Name Status_List_Box


Control Type List Box

Enter the static values Since this data type is a list box, it needs static text values for the items the
for the data type. user will be able to select. Be sure that Text appears in the Static Values field.
If it doesn’t, select Text from the Static Values drop-down list. Then click the
Static Values lookup button to display the Static Text Values window. Enter
the following items one at a time in the New Value field, clicking Insert after
you type each item.

In Stock
On Order
Back-ordered

QUICK START 29
PA RT 2 L E S S O N S

When you’ve finished, the Static Text Values window should look like the
following illustration.

Enter new static text


values here.
These static text values
will appear in the list box.
Click Insert to add the
new value to the Static
Text Values list.

Click OK to save the static values, then click Add in the Data Type
Definition window.
Create the data type for Now you’ll create the data types for the three push buttons. For the Save
the Save button. button, make the following entries in the Data Type Definition window
without clicking Add:

Data Type Name Push_Button_Save


Control Type Push Button

Enter the static value To enter Save as the static text value that appears on the push button, be
for the data type. sure that Text - Picture appears in the Static Values field, then click the Static
Values lookup button to open the Static Text Values window. In the Button
Items window, type Save in the field for Up caption.

30 Q U I C K S T A R T
C H A P T E R 4 C R EA T IN G DA TA T Y P E S

The window should look like the following illustration.

Type the static text for the


push button here.

Click OK to close the Button Items window and save the value. The Data
Type Definition window will be displayed, as shown in the following
illustration.

Click Add to save the Push_Button_Save data type.

Create the data type for Using the same procedure, create the Push_Button_Clear and
the Clear button. Push_Button_Delete data types. For the Push_Button_Clear data type, enter
the following information:

Data Type Name Push_Button_Clear


Control Type Push Button
Static Values: Text Clear

Click Add to save the data type.

QUICK START 31
PA RT 2 L E S S O N S

Create the data type for For the Push_Button_Delete data type enter the following information and
the Delete button. click OK to save the data type:

Data Type Name Push_Button_Delete


Control Type Push Button
Static Values: Text Delete

When you’ve finished creating the data types, the Resource Explorer will
list all of the new data types and appear as shown in the following
illustration.

In this chapter you’ve learned how to create the data types needed for the
Inventory application, including how to add static text to push button and
list box fields.

32 Q U I C K S T A R T
Chapter 5: Creating Formats
Formats are the extra characters, spacing and attributes that can be applied
to a data type to format data when it is entered or displayed. Formats are
stored as separate resources, but are applied to data types to define how
information is displayed at runtime.

Refer to Chapter 7, A single format resource can be used by several data types. Perhaps the
“Formats,” in Volume easiest way to understand formats and how they’re used is to view them as
1 of the Dexterity Pro- data “masks” that simply change the look of the information in a field
grammer’s Guide for without changing the actual information stored in the field. For example, a
more information string data type for a phone number can have a format applied to it so a
about formats. field using the data type will display (555) 123-4567, instead of 5551234567,
which is stored in the phone number field in a table.

Formats can be used for currency, string, numeric and composite data
types. If the format is for use with a string or composite data type, it can
also have a format string. Depending upon the format type, different
formatting options are available. The Format Definition window, shown in
the following illustration, is used to set the characteristics of a format.

The format type is


selected based on the
data type.

Options for the format are


chosen here.

Format strings are


entered here.

QUICK START 33
PA RT 2 L E S S O N S

Lesson: Creating formats


This lesson will show you how to create formats for the sample Inventory
application. Two data types in the Inventory application require formats.
The Part Number field should have a dash between the second and third
digits, and the Cost and Selling Price fields should display the currency
symbol and the thousands separator.

Be sure the Resource Explorer window is displayed. If it isn’t, click the


Open Resource Explorer button on the Dexterity toolbar to open it. Select
the Base category in the left pane of the Resource Explorer. Click the plus
sign to expand the Base group. Select the Data Types item. The right pane of
the Resource Explorer will display the data types that have been created for
the dictionary.

Select the Part_Number_String5 data type in the right pane of the Resource
Explorer and click the Open button in the Resource Explorer toolbar. The
Data Type Definition window will appear.

You also can open a data type by double-clicking its name.

Create the format for Click the Format lookup button to open the Format Lookup window. The
the Part_Number_ lookup button is located to the right of the Format field. Click New to create
String5 data type. a new format; the Format Definition window will appear. Enter the
following information:

Format Name Part_Number


Alignment Left
Fill Space
String Options Alphanumeric Only
Format String XX-XXX

The capital Xs are used as place holders in the format string. They designate
positions in which data will appear. Any other characters specified in the
format string, such as the dash between the second and third X, will appear
as part of the format applied to the data.

34 Q U I C K S T A R T
C H A P T E R 5 C R E AT IN G FO R M AT S

Click Insert; the window will look like the following illustration.

Click OK to save the new format. Its name will appear in the format field of
the Data Type Definition window as shown in this illustration.

Click OK to save the changes to the data type.

Create the format for Now you’ll create and apply a format to the Currency7 data type. Open the
the Currency7 data Currency7 data type by selecting it in the Resource Explorer and clicking
type. Open in the toolbar. Click the Format lookup button to open the Format
Lookup window, and click New to create a new format. In the Format
Definition window, enter the following information:

Format Name Currency7


Alignment Left
Decimal Digits 2
Fill Space
Negative Symbol System
Currency Options Show Thousands Separator
Show Currency Symbol

These format selections define how currency values will be displayed in


fields using the data type associated with this format. By specifying 2
decimal digits, only two digits will be displayed to the right of the decimal
separator, regardless of whether the data actually contains data in the third,
fourth and fifth decimal positions.

QUICK START 35
PA RT 2 L E S S O N S

The Fill option allows you to specify whether a space, zero or asterisk will
be displayed in unused positions to the left of the decimal separator.
Regardless of what is specified here, unused positions to the right of the
decimal separator will be displayed as zeros. For example, a currency field
that displays 7 digits, displays 2 decimal digits and uses an asterisk as the
fill character will be displayed as ***12.00 when the field has the value 12.

Choosing System as the Negative Symbol specifies that the operating


system setting for the negative symbol will be used to denote negative
values.

When you’ve finished, the window should look like the following:

Click OK to save the format definition. The format name will appear in the
Format field in the Data Type Definition window. Click OK to save the
changes to the data type.

In this chapter you’ve learned about adding formats to data types, and
you’ve created formats for the Part_Number_String5 and Currency7 data
types you created in the previous chapter.

36 Q U I C K S T A R T
Chapter 6: Creating Fields
For more information This chapter will show you how to create fields for the sample Inventory
about each type of application. Fields you create using Dexterity represent individual pieces of
field, refer to Chapter information that can be used by your application dictionary. Dexterity
8, “Global Fields,” in allows two kinds of fields, global and local.
Volume 1 of the
Dexterity Global fields can appear in any of your application’s windows and can be
Programmer’s Guide. stored in tables. Local fields can only appear in windows that are part of the
form in which they are created.

Each global field in an application has a field name, a physical name, an


associated data type and an array size. As explained in the previous
chapter, the data type associated with a field is used to define the
characteristics of the field. Specifying an array size makes the field an array
field. Array fields contain multiple occurrences of the same type of data. For
example, if an array size of 2 is specified for the Phone Number field, two
separate phone numbers can be stored in one Phone Number field.

QUICK START 37
PA RT 2 L E S S O N S

Lesson: Creating fields


You need to create a total of eight fields in the Inventory application: one
each for the part number, description, cost, selling price and status, as well
as the Save, Clear and Delete push buttons.

Be sure the Resource Explorer window is displayed. If it isn’t, click the


Open Resource Explorer button on the Dexterity toolbar to open it. Select
the Base category in the left pane of the Resource Explorer. Click the plus
sign to expand the Base group. Select the Fields item. The right pane of the
Resource Explorer will display any global fields that have been created for
the dictionary. Click the New button in the Resource Explorer toolbar to
create a new field. The Field Definition window will appear.

To create the Part Number field, enter the following information in the Field
Definition window:

Field Name Part Number


Physical Name Part Number
Array Size 0
Data Type Part_Number_String5

You’ll use the field name when you refer to the field in scripts. The physical
name is used as the column name in a SQL table.

Notice that when you move to the Physical Name field, it’s automatically filled in
with the value specified as the field name. Notice also that the Array Size field value
defaults to zero, indicating the field is not an array.

The Field Definition window should appear as shown.

The data types you’ve


defined using the Data
Type Definition window
are listed here.

Click Add to save the Part Number field definition and leave the Field
Definition window open so you can create another field.

38 Q U I C K S T A R T
C H A P T E R 6 C R E A T IN G F IE LD S

Using the same method, create the Description field. Enter the following
information and click Add:

Field Name Description


Physical Name Description
Array Size 0
Data Type String30

Enter the following information for the Cost field and click Add:

Field Name Cost


Physical Name Cost
Array Size 0
Data Type Currency7

Enter the following information for the Selling Price field and click Add:

Field Name Selling Price


Physical Name Selling Price
Array Size 0
Data Type Currency7

Enter the following information for the Status field and click Add:

Field Name Status


Physical Name Status
Array Size 0
Data Type Status_List_Box

Create the push button Now create the fields for the three push buttons. For the Save Button field,
fields. enter the following information and click Add:

Field Name Save Button


Physical Name Save Button
Array Size 0
Data Type Push_Button_Save

Enter the following information for the Clear Button field and click Add:

Field Name Clear Button


Physical Name Clear Button
Array Size 0
Data Type Push_Button_Clear

QUICK START 39
PA RT 2 L E S S O N S

Enter the following information for the Delete Button field:

Field Name Delete Button


Physical Name Delete Button
Array Size 0
Data Type Push_Button_Delete

Since the Delete Button is the last field you need to create for the Inventory
application, click OK to save the field definition and close the Field
Definition window.

When you’ve finished, the newly-defined fields will be displayed in the


Resource Explorer as shown in the following illustration.

In this chapter you’ve learned to create fields using the Field Definition
window, and you’ve created the fields you will need for the Inventory
application.

40 Q U I C K S T A R T
Chapter 7: Creating Tables
Understanding how data is stored in tables will help you better visualize
how your application will process and store information.

As explained in Chapter 6, “Creating Fields,” fields store individual pieces


of data. For instance, if you were to track customer names and addresses,
you could use the following fields:

Fields

Customer ID Customer Address City State


Name

A record is made up of one instance of each field in a table. All of the


records in a table contain the same fields (categories of data). For example,
in a table that keeps track of customer names and addresses, think of a
record as one row in the table. Each row (record) contains the information
for one customer.

Customer ID Customer Address City State


Name

C1002 Jean P.O. Box 8392 Kansas MO


Thompson 82 101 Ave. City

Record C1392 Serge 11 Ash Lane Edmonton AB


Lemieux

C4432 Dan Smith 239 Hampton Fargo ND


Village

C4499 Cheryl Miner 9800 Woodland Springfield IL


Drive

QUICK START 41
PA RT 2 L E S S O N S

A table is a collection of records, such as your business’s customer records.


Tables in Dexterity group related records the same way the table in the
following illustration groups customer records.

Customer ID Customer Address City State


Name

C1002 Jean P.O. Box 8392 Kansas MO


Thompson 82 101 Ave. City

C1392 Serge 11 Ash Lane Edmonton AB


Lemieux

C4432 Dan Smith 239 Hampton Fargo ND


Village

C4499 Cheryl Miner 9800 Woodland Springfield IL


Drive

Table

Each table requires at least one key. A key is a field or combination of fields
within a record that is used to store, retrieve and sort records. Typically, the
value of the key field or fields is unique for each record so a particular
record can be located easily.

A key is like a category you can use to locate a particular item. For instance,
to locate a particular customer in the customer name and address table, you
could search the table alphabetically using the customer name column. In
this case, you’re using the customer name field as the key. However, since
two or more customers could have the same name, a unique field such as
the Customer ID also might be used as a key field.

42 Q U I C K S T A R T
C H A P T E R 7 C R E A TI N G T AB LE S

The following example shows how a customer table in Dexterity could


store information for customer records.

Fields
Key 1 Customer ID Customer Address State
City
Key 2 Name

C1002 Jean P.O. Box 8392 Kansas MO


Thompson 82 101 Ave. City

Record C1392 Serge 11 Ash Lane Edmonton AB


Lemieux

C4432 Dan Smith 239 Hampton Fargo ND


Village

C4499 Cheryl Miner 9800 Woodland Springfield IL


Drive

Table

This table has five fields: Customer ID, Customer Name, Address, City and
State. It also has four records, each containing one Customer ID, Customer
Name, Address, City and State field. The table has two keys. The first key is
composed of the Customer ID field. Because no two customers can have the
same Customer ID, this key ensures each customer is uniquely identified.
The second key is composed of the Customer Name field. This key allows a
customer record to be easily located, based upon the customer’s name.

QUICK START 43
PA RT 2 L E S S O N S

Lesson: Creating tables


This lesson will show you how to create the table for the sample Inventory
application. The Inventory application requires only one table to store the
information for the list of items in inventory. You’ll want to look up items
by the part number, so the Part Number field will be used as the key field.

To create the table for the Inventory application, be sure the Resource
Explorer window is displayed. If it isn’t, click the Open Resource Explorer
button on the Dexterity toolbar to open it. Select the Tables category in the
left pane of the Resource Explorer. The right pane of the Resource Explorer
will display any tables that have been created for the dictionary. Click New
to create a new table; the Table Definition window will appear. Enter the
following information without clicking OK:

Enter the table Table Name Inventory_Data


information. Display Name Inventory Data
Physical Name Inventor
Series 3rd Party
Database Type c-tree

You’ll notice that once you enter the table name and move to the next field,
Dexterity enters default values for the Display Name and Physical Name
fields. The display name is the name that will appear when the table is
referred to in the Report Writer and Modifier. The physical name is the
name for the table used by the database. It defaults to an eight-character
name that can be used by any supported database type.

The Series field allows you to categorize and group related tables. For
example, because the Inventory application is a stand-alone application,
you’ve selected 3rd Party as the series. Had this application integrated with
another product such as Microsoft Dynamics GP, you would have chosen
the series used by the module your application integrated with.

44 Q U I C K S T A R T
C H A P T E R 7 C R E A TI N G T AB LE S

Add fields to the table. The Global Fields list displays the fields you created in the previous
chapter. Add the following fields to the table one at a time by selecting each
in the Global Fields list and clicking Insert to place it in the Table Fields list.

Part Number
Description
Cost
Selling Price
Status

When you’ve finished, the Table Definition window should resemble the
following illustration.

Click this button to create


the key for this table.

Be sure the Use 4 byte header option is marked.

QUICK START 45
PA RT 2 L E S S O N S

Creating the table’s key


Now you’ll create the key for the table. Click New in the Keys section to
open the Key Definition window. Enter the following information without
clicking OK:

Key Name Inventory_Data_Key1

The data should be sorted by part number, so select the Part Number field
in the Table Fields list and click Insert to place it in the Key Segments list.
No options need to be selected for this key. The Keys window should
resemble the following illustration.

Click OK to save the key and return to the Table Definition window. The
key’s name will appear automatically in the drop-down list in the Keys
section of the window. Click OK to save the table definition. The table’s
name will appear in the Resource Explorer.

In this lesson you’ve learned how to use the Table Definition and Key
Definition windows to define a table and its keys.

46 Q U I C K S T A R T
Chapter 8: Creating Forms
Dexterity allows you to define your application’s interface, through the use
of forms and windows. Understanding how to use forms and windows will
help you design an intuitive, logical interface, allowing users to easily enter,
view and change information.

After you create data types, fields and tables, you can begin setting up your
application interface by first defining the forms, and then the windows
your application will use. Although forms and windows are stored as
separate resources in Dexterity, both work together to give structure to the
tasks you’re designing your application to complete.

Creating windows is A form groups related objects and resources, such as windows, menus,
discussed in the next scripts and tables, that function together for a common purpose. A single
chapter. Form menus form may have several windows that can be displayed and used separately.
are discussed in
Chapter 12, “Creating For example, you could create a form that uses one window to store
Menus.” Form scripts information about customer addresses and another window to store your
are explained in notes about the customer. Together, both windows allow you to maintain
Chapter 10, “Adding customer records. The information entered in the windows is stored in
Scripts.” tables attached to the form. The overall structure of the form is shown in the
following illustration.

Form

Windows
in the form
Table
buffers

Form menus Form scripts Tables attached to the form

QUICK START 47
PA RT 2 L E S S O N S

The Main Menu form


Each stand-alone application dictionary must have a form named Main
Menu that will be the first form opened when the application starts. The
Main Menu form serves as a starting point for the application, allowing the
user to navigate to other parts of the application.

Applications that integrate with Microsoft Dynamics GP don’t need a Main Menu
form. Integrating applications use the Main Menu form from the main dictionary.

For information on the The window associated with the Main Menu form is usually a standard
types of windows you window or a tool bar window, often containing push buttons or button
can create using drop lists used to open other forms in the application.
Dexterity, refer to
Chapter 9, “Creating Since Dexterity requires a Main Menu form, it automatically adds one to
Windows.” each new dictionary. However, you’ll have to attach your own tables to the
form, and define your own windows, menus, scripts and other objects for
the form. You’ll do this in subsequent chapters.

48 Q U I C K S T A R T
C H A P T E R 8 C R E A TI N G F O R M S

Lesson: Creating forms


This lesson will show you how to create the forms for the Inventory
application. Before beginning this lesson, be sure you’ve created the table
for the application as described in the previous chapter, “Creating Tables.”

In this lesson you will create a new form and attach the Inventory_Data
table to it.

To create a new form for the Inventory application, be sure the Resource
Explorer window is displayed. If it isn’t, click the Open Resource Explorer
button on the Dexterity toolbar to open it. Select the Forms category in the
left pane of the Resource Explorer. Notice that the Main Menu form is
already listed in the right pane of the Resource Explorer. Click New to
create a new form; the Form Definition window will appear

Create the Enter the following information:


Inventory_Mainte-
nance form. Form Name Inventory_Maintenance
Series 3rd Party

When you’ve finished, the Form Definition window should resemble the
following illustration.

Click here to bring the


Tables tab to the front.

Attach the Click the Tables tab to bring it to the front. The New button shown in the
Inventory_Data table to previous illustration will be replaced by the Attach button.
the form.

QUICK START 49
PA RT 2 L E S S O N S

Click the Attach button to open the Table Lookup window, shown in the
following illustration. This window lists all tables that have been defined in
the current dictionary.

Select the Inventory_Data table and click OK. The Table Lookup window
will close, and the Inventory_Data table will be listed in the Tables tab of
the Form Definition window.

Verify the table Make sure the Inventory_Data table is selected in the Tables tab of the Form
options. Definition window. The Open, Detach and Options buttons will be enabled.
Click the Options button to open the Table Options window. Set the Open
Options as shown in the following illustration.

When you’ve made any necessary changes, click OK to close the Table
Options window. To save the new form, click OK in the Form Definition
window; the name of the form will appear in the Resource Explorer.

In this chapter you’ve learned how to create a form, attach tables to the
form, and set the options for that table when it’s accessed by the form.

50 Q U I C K S T A R T
Chapter 9: Creating Windows
Dexterity supports four A window is the main method of communication between the user and
kinds of windows: your application. It consists of the visual area displayed on the screen that
standard, modal, can contain editable fields, interactive controls such as push buttons, and
palette and tool bar. static items such as prompts. Dexterity supports several types of windows.
The most common four are: primary, modal dialog, palette and tool bar.

• Primary windows are the most common type of window and appear
with all operating system controls, such as close boxes and minimize
controls.

• Modal dialogs don’t contain any operating system controls and can’t be
resized. These windows can be used when you require the user to com-
plete an action in the window before closing the window.

• Palette windows can be used as a device for navigation throughout your


application. Palette windows are similar to the tear-off menus found in
other applications. Palettes are used to group windows or tasks that
perform similar functions, such as windows you use to maintain inven-
tory items.

• Toolbar windows are displayed across the top or down the left side of the
screen, expanding automatically to fit the size of the screen. Only one
tool bar window can be open at a time. A toolbar window can’t be
closed and always appears in front of other windows at runtime.

Each element in a window can have multiple characteristics, or properties,


attributed to it. Different types of elements have different types of
properties that can be set for them.

When you display the Form Definition window with the Windows tab
selected, all of the windows in that form will appear in the tab’s list area.
When you add windows, each will be added to the top of the list if no
window is selected, or directly below any highlighted window in the list.
The first window is considered the form’s main window; the order of the
remaining windows isn’t critical. If a user closes a form’s main window, the
entire form will be closed. Windows are unique to a single form, so they
can’t be shared among multiple forms.

QUICK START 51
PA RT 2 L E S S O N S

Lesson: Creating windows


This lesson will show you how to create the windows for the Main Menu
form and the Inventory_Maintenance form. The window for the Main
Menu form will be a primary window with a single push button that will
open the Inventory_Maintenance form. The Main Menu form will remain
open while the Inventory application is running.

The window for the Inventory_Maintenance form will display the part
number, description, cost, selling price and ordering status. It must also
provide a way to enter and retrieve information.

Before beginning this lesson, be sure you’ve created the forms for the
Inventory application as described in the previous lesson.

To create the window for the Main Menu form, be sure the Resource
Explorer window is open. Display the forms that have been created in the
dictionary. Select the Main Menu form from the forms list, and click the
Open button in the Resource Explorer toolbar to open the Form Definition
window.

You can also open a form by double-clicking its name in the Resource Explorer.

52 Q U I C K S T A R T
C H A P T E R 9 C R E A T I N G W I N D O W S

Create the window for With the Windows tab in the foreground, click New to open the Window
the Main Menu. Layout window. The Window Layout window, and its accompanying
Toolbox and Properties windows, will appear as shown in the following
illustration. If the Properties window doesn’t appear, you can open it by
choosing Properties from Layout menu.

Use the Properties window


Use the Toolbox to add to set the characteristics of
objects to the window the window, or of selected
layout. items in the window layout.

Resize handles appear Clicking a property displays


when the window is its value at the top of the
selected. tab, where you can set it.

When the Window Layout window first opens, the entire window is
selected, and window-related properties appear in the Properties window.
As you move the pointer from the Toolbox to the Window Layout and
Properties windows, the window in which the pointer is currently located
will become active.

QUICK START 53
PA RT 2 L E S S O N S

Specify the name of With the entire window selected and the Object tab selected in the
the window that will be Properties window, click the Name property in the property list. The Name
used when referring to property will appear at the top of the tab with its default value, Window1.
the window in scripts. Replace that value with Main_Menu_Window and press ENTER to save
your change.

Specify the window’s Using the same procedure, change the Title property’s value to Main
title. Menu. This is the value that will appear in the window’s title bar at
runtime.

Be sure that the following properties located in the Object tab are set as
follows:

AutoOpen True
CloseBox False
Resizeable False
WindowType Primary

Next, click the Visual tab to view the properties related to the appearance of
the window. Be sure that the following properties located in this tab are set
as follows:

BackColor True
ControlArea False

These properties indicate this will be a standard window that will open
when the form is opened. The window will have a colored background, and
users won’t be able to resize the window.

Now that you’ve set the window’s properties, you’re ready to use the
Toolbox to add objects to the layout area.

First, you’ll need to add text to the window to identify the application. To
do this, click the text tool (shown at left) in the Toolbox. When you move the
pointer to the layout area, the appearance of the pointer will change. It will
appear as the plus sign (+) followed by the letter “A”.

Click in the middle of the layout area. When the blinking insertion point
appears, type the following:

Inventory Application

54 Q U I C K S T A R T
C H A P T E R 9 C R E A T I N G W I N D O W S

When you’ve finished typing, click the arrow tool (shown at left) in the
Toolbox, and use it to select the text you’ve just entered in the layout area.
Once the text is selected, set the following properties under the Visual tab in
the Properties window:

Font Helvetica 24
FontColor Dark Blue

When setting the color, you will need to display the Color tab in the
FontColor window. After you’ve finished, the Properties window should
appear as shown in the following illustration:

This indicates that a text


object is selected in the
layout area.

These values represent


the position and size of
the window, and may be
different on your screen.

You’ll need to resize the text field, as the space previously allocated for it in
the window layout is insufficient to display the text using the newly-
selected font. When you’ve finished resizing the text field, the layout area
should appear as shown in the following illustration:

QUICK START 55
PA RT 2 L E S S O N S

Create a push button Next, create a local push button for this window. It will be used to open the
for the window. Inventory_Maintenance form you created in the previous lesson.

To create the local push button, be sure the Layout tab is selected in the
Toolbox. Then, select Local Fields from the drop-down list located in the
center of the Toolbox. Click New to open the Local Field Definition window.
Enter the following information without clicking OK:

Field Name Inventory Button


Array Size 0
Data Type Local
Control Type Push Button

The Local Field Definition window should appear as follows:

Add static text to the To enter a static value for the push button, click the Static Values lookup
push button. button. The Button Items window will open. Enter the following
information as the “Up” caption.

New Value Inventory

56 Q U I C K S T A R T
C H A P T E R 9 C R E A T I N G W I N D O W S

When you’ve finished, the Button Items window should look like the
following illustration.

Click OK to save the static value and click OK in the Local Field Definition
window to save the local field. The local field name should appear in the
list in the Toolbox. Click its name in this list, and drag it to the layout area.

When you’ve finished, the window should resemble the following


illustration.

The (L) preceding the


name of the push button
indicates that it is a local
field.

In a window layout, fields can appear with their field names or as they appear when
the application is run. The remainder of this manual displays the fields with their
field names. To display field names, be sure the Show Field Names item is marked in
the Layout menu.

QUICK START 57
PA RT 2 L E S S O N S

Position the window. Choose Position Window from the Layout menu. A window that’s the same
size of the window you’re creating will open. Move the window to the
center of the screen and click OK to set the opening position of the window.

You could also position the window using the Position-Left and Position-Top
properties. However, to do this, you’ll have to know the coordinates of the desired
window position.

Preview the window. To see how the window will appear at runtime, choose Preview from the
Layout menu. A new window will appear in the foreground. The title bar
will contain the word Preview, followed by the window title that will
appear in the window at runtime. When you’ve finished previewing the
window, close the window using the window’s close box.

If you’re satisfied with the appearance of the window, close the layout
window and save your changes. Click OK in the Form Definition window
to save the form.

Create the window for Next, you need to create the window for the Inventory_Maintenance form.
the Inventory_ Select Inventory_Maintenance from the list of forms in the Resource
Maintenance form. Explorer and click the Open button on the Resource Explorer toolbar. With
the Windows tab in the foreground, click New to open the Window Layout
window.

With the entire window selected and the Object tab selected in the
Properties window, set the following properties to the specified values:

Name Inventory_Maintenance
Title Inventory Maintenance
AutoLinkTable Inventory_Data
AutoOpen True
CloseBox True
Resizeable True-Automatic
WindowType Primary

Next, click the Visual tab to view the properties related to the appearance of
the window. Be sure that the following properties located in this tab are set
as follows:

BackColor True
ControlArea False

58 Q U I C K S T A R T
C H A P T E R 9 C R E A T I N G W I N D O W S

If you plan to allow These settings indicate that this will be a standard window that has a close
users to use the box and is resizeable. It will have a light gray background and open when
Modifier with a stand- the form is opened. The window will be auto-linked to the Inventory_Data
alone application, refer table to allow the Modifier to access fields from the table. The Modifier is a
to your Dexterity customization tool that you can distribute with your application. It allows
licensing agreement users to make modifications to your application, such as changing prompts.
for information about
distributing the When you’ve finished setting these properties, the Object and Visual tabs of
Modifier. the Properties window should appear similar to ones shown in the
following illustration.

The numeric values in the above illustration, such as the Position-Top and Size-
Height properties, may be different than the ones that appear on your screen. These
differences are normal and are not a problem.

Add fields to the layout Now you’re ready to add fields to the window layout. Be sure Global Fields
area. is selected in the Toolbox’s drop-down list. Each global field defined in the
dictionary will appear in the tab’s list area. Drag each field, in the order
listed below, to the layout area and position them as shown in the following
illustration. You may find it necessary to resize the window using the resize
handles.

Part Number Status


Description Save Button
Cost Clear Button
Selling Price Delete Button

QUICK START 59
PA RT 2 L E S S O N S

For detailed To align fields in the Layout area as precisely as shown in the previous
information about each illustration, use the Tile tools located in the Arrange tab of the Toolbox, as
tool in the Toolbox, shown in the following illustration.
search the online help
for Toolbox.

Tile Horizontally tool Tile Vertically tool


The number of pixels to
leave between fields

To align the Part Number, Description, Cost and Selling Price fields, select
all four fields and click the Toolbox’s Arrange tab to bring it to the
foreground. Enter 10 in the Space field, and click the Tile Vertically tool to
space them 10 pixels apart. To evenly space the Save, Clear and Delete
buttons, select all three buttons and use the Tile Horizontally tool to space
them 13 pixels apart.

To select multiple fields in the layout area, use the arrow tool to draw a box around
the desired fields. You can also select multiple fields by holding down the SHIFT key
and clicking each desired field in the layout area.

60 Q U I C K S T A R T
C H A P T E R 9 C R E A T I N G W I N D O W S

Set the field properties Most of the properties for each field are set by default to the values you’ll
for each field. want to use. However, there are some properties you’ll need to set. First,
you should set the Appearance property under the Visual tab for each of the
non-button fields.

You can set the properties for multiple fields by selecting those fields in the layout
area and then moving the cursor to the Properties window. Only properties the
selected fields have in common will be displayed.

Appearance 3D Border
BackColor System-Window Background
FontColor System-Window Text

Next, you’ll need to set the Required property under the Object tab for the
Part Number and Description fields.

Required True

Label the fields. Use the text tool to add a prompt next to or above each field in the window.
Use the field’s name, followed by a colon(:), as its prompt.

Once you’ve created all the prompts, use the Align tools on the Arrange tab
to align the prompts with their fields.

Use the line tool (shown at left) to draw a separator between the push
buttons and the rest of the fields in the window. Once you’ve drawn the
line, select it, and be sure the following properties under the Visual tab in
the Properties window:

Appearance 3D Border
LineColor System

When you finish, the window should resemble the following illustration:

QUICK START 61
PA RT 2 L E S S O N S

Preview the window. Choose Preview from the Layout menu to see how the window will appear
at runtime. Note any problems that you find, such as misaligned fields, an
incorrect window title or problems with the line you drew using the line
tool. When you’ve finished previewing the window, close the preview
window to return to the Window Layout area and make any necessary
changes.

Set the tab sequence. The next step is to set the tab sequence for the fields. Choose Set Tab
Sequence from the Layout menu. The first field in the tab sequence will be
highlighted. If the Part Number field isn’t highlighted, double-click it, then
press the TAB key to move to the next field, Description. If the tab doesn’t
move the highlight to the Description field, double-click the Description
field. Continue this process until pressing the TAB key highlights each field
in the order shown in the following list:

Part Number
Description
Cost
Selling Price
Status
Save Button
Clear Button
Delete Button

The initial tab sequence is determined by the order in which you placed the fields on
the window. If you placed the fields in the window in the order suggested, the tab
sequence should have been correct the first time.

Once you’ve set the tab sequence in the above order, choose Set Tab
Sequence from the Layout menu again to unmark the menu item.

Link fields to their text Now link the fields with their prompts. By linking fields, the status of the
prompts. field is indicated by its prompt. For example, if the field is disabled, the text
linked to the field will appear in gray, indicating data can’t be entered in the
field.

The cursor changes To link fields to their prompts, choose Link Prompt from the Tools menu.
appearance when You’ll know when the Link Prompt mode is turned on, as the cursor will
you’re in Link Prompt appear as an arrow next to a box containing the letters ABC when it is
mode. positioned in the layout area.

62 Q U I C K S T A R T
C H A P T E R 9 C R E A T I N G W I N D O W S

Click the name of the field to link and drag the pointer to the prompt
associated with it. A dotted line will appear showing the link. Release the
mouse button. A dark flashing line will indicate the link was made, as
shown in the following illustration.

When you’ve linked the Part Number, Description, Cost, Selling Price and
Status fields to their prompts, choose Link Prompt from the Tools menu to
end the linking process.

Set the opening The last step is to set the default opening position for the window, just as
position of the you did for the Main Menu window. Choose Position Window from the
window. Layout menu. A window the same size as the one you’re creating will
appear. Move it to the center of the screen. Click OK to save the location.

Close the layout window and save your changes. Click OK in the Form
Definition window to save the changes to the form.

In this chapter you’ve learned how to create a standard window. You’ve


also learned how to place fields and prompts in the window layout area,
how to set properties for items in the layout area, how to link fields to their
prompts and how to set the tab sequence.

QUICK START 63
64 Q U I C K S T A R T
Chapter 10: Adding Scripts
For more information The Dexterity development system has its own programming language,
about the sanScript sanScript, that you’ll use to control how your application operates. Unlike
language, refer to Part many traditional languages that require you to write long sequences of
1, sanScript, in program code, sanScript is written in small segments, or scripts, that are
Volume 2 of the attached to objects in an application dictionary, such as fields, menus,
Dexterity windows and forms. Scripts are run as the user interacts with the objects the
Programmer’s Guide. scripts are attached to.
For information about
specific commands, This script-based approach and sanScript’s English-like instructions are
refer to the SanScript designed to make Dexterity applications easier to write than applications
Reference manual. written with other languages. If you’ve had experience writing programs in
other languages such as Pascal or BASIC, you’ll find many concepts are
similar in sanScript.

Refer to Chapter 3, The three most common kinds of scripts in Dexterity are pre, change and
“Attaching Scripts,” in post scripts:
Volume 2 of the
Dexterity • Pre scripts can be attached to forms, windows and fields. Form or win-
Programmer’s Guide dow pre scripts run just as the form or window is opened. Field pre
for more information scripts run when focus moves to the field.
about the different
types of scripts in • Change scripts can be attached to fields only. Field change scripts run
Dexterity. when focus leaves the field if the value in the field has changed. If a
change script is attached to a push button, it runs when the button is
clicked.

• Post scripts can be attached to forms, windows and fields. Form or win-
dow post scripts run just as the form or window is closed. Field post
scripts run when focus leaves the field, regardless of whether the field’s
value has changed.

QUICK START 65
PA RT 2 L E S S O N S

Lesson: Adding scripts


This lesson will show you how to write and attach the scripts used in the
Inventory application. Before you begin this lesson, be sure you have
created all of the windows for the Inventory application, as described in the
previous lesson.

You’ll be writing scripts that perform these basic functions:

• Open the Inventory_Maintenance form when the Inventory button is


clicked.

• Clear the Inventory Maintenance window when the Clear button is


clicked.

• Store the current record when the Save button is clicked.

• Delete the current record from the table when the Delete button is
clicked.

• Retrieve information about an item when its part number is entered.

To add a script to the Inventory button, display forms in the Resource


Explorer. Double-click the Main Menu form in the list of forms in the
Resource Explorer to open its Form Definition window. Select
Main_Menu_Window from the list in the Windows tab and click Open.

You can also open a window’s Layout window by double-clicking the window
name.

Attach a script to the When a user clicks the Inventory Button at runtime, the
Inventory push button. Inventory_Maintenance form should open and display the
Inventory_Maintenance window. Since the act of clicking the button
changes the Inventory Button field, you need to attach a change script to the
push button.

With the Main_Menu_Window’s Layout window open, select the Inventory


Button in the layout area. In the Properties window, select the Script tab,
and click the Change property; the Change property will appear at the top
of the tab, next to a lookup button. Click the lookup button to open the
Script Editor window.

66 Q U I C K S T A R T
C H A P T E R 1 0 AD D IN G S C R IP T S

You can open the change script for a field by double-clicking that field in the layout
area. However, you must use the Script tab of the Properties window to access a
field’s pre or post script.

Enter the following line of script. It opens the Inventory_Maintenance form


and all windows in that form that have the AutoOpen property set to true.
Since the Inventory_Maintenance window has this property set to true, this
script will open that window.

open form Inventory_Maintenance;

The sanScript language is case-sensitive. Also, each complete sanScript statement


must be ended with either a period or semicolon. Throughout this documentation, a
semicolon is used.

When you’ve finished, the Script Editor window should appear as shown
in following illustration.

Click Compile to verify


that the script’s syntax is
correct.
The script text is entered
here.

The script’s name is


assigned by Dexterity.

Notice that the text you typed in appears in two colors. The different colors
indicate the various elements of the syntax, like keywords, names and
comments. The colors reduce errors when you type scripts and also make
them easier to read.

QUICK START 67
PA RT 2 L E S S O N S

Click Compile to verify and save the script. If there are any problems in the
script, they will be listed at the bottom of the Script Editor window.

Click this button to


display the Compile
Messages window.

Use these buttons to Any errors or warnings


move between messages. are displayed here.

Depending on how sanScript options have been set in Dexterity, any


compiling problems may also be listed in the Compile Messages window.
This window, shown in the following illustration, lists all of the compiling
errors and warnings for the current script.

Compiling problems can


also be displayed in the
Compile Messages
window.

Compiler errors are problems in a script that prevent it from being compiled, such
as syntax errors. Compiler warnings are less serious problems that won’t prevent a
script from being compiled, but should be resolved.

If any compiler errors are listed, be sure you have entered the script exactly
as shown and that the Inventory_Maintenance form created previously has
the correct name. To check the spelling of the form name, click the Names
button to open the Names window, which lists the names of all forms,
windows, tables and fields defined in the application. In the Names
window, click the Forms button to list the names of the forms in the
Inventory application.

68 Q U I C K S T A R T
C H A P T E R 1 0 AD D IN G S C R IP T S

If there are no errors, click Close to close the Script Editor window. Close
the Layout window and save the changes. Click OK in the Form Definition
window to save the form.

Test the Inventory Now you’ll be able to run the Inventory application to test the windows
application windows and script you’ve created. Choose Test Mode from the Debug menu. The
and the script you tool bar will disappear and the main window that you created will open, as
created. shown in the following illustration.

Click the Inventory button to open the Inventory Maintenance window. It


should look similar to the following illustration.

Test the Inventory Enter some data in the fields and click the buttons. No processing will occur
Maintenance window. since you haven’t attached any scripts to these buttons yet. Test the tab
sequence. Choose Show Required Fields from the Help menu. The prompts
for the Part Number and Description fields should be displayed in boldface
type. This shows you which fields must contain entries before you can save
a record.

QUICK START 69
PA RT 2 L E S S O N S

If the push buttons or the status list box appear without text values, you
may not have given them static values. Refer to Chapter 4, “Creating Data
Types,” for information about adding static values.

When you’ve finished testing the window, close it. Choose Test Mode from
the Debug menu to exit test mode. If the windows appeared and functioned
properly, you’re ready to attach the remaining scripts.

Add the Pathname For the sample application to work properly, you must add code that will
procedure script that tell the application where to look for data. This is done by adding a
tells the application procedure script with the special name “Pathname” to the application
where to look for data. dictionary.

In the Resource Explorer, display the procedures and functions that have
been defined for the dictionary by clicking the Scripts node in the Resources
Tree.

1. Choose to create a new procedure script.


In the Resource Explorer, click the New button to create a new
procedure script.

2. Name the new procedure.


The Script Editor window will be displayed. In the Procedure field,
enter the name for the procedure:

Procedure Pathname

3. Add the script for the procedure.


Add the following code for the new Pathname procedure:

in integer dict_id;
in integer table_series;
in integer table_group;
out string data_path;

{Indicate the data location is the same as the dictionary}


data_path = Dict_GetPathname(PATH_SETFOLDER);

This sanScript code specifies that the application should look in the
same location as the application dictionary for the data files.

4. Compile the script.


Click Compile to compile the script. If necessary, fix any errors found
and compile the script again. Click Close to close the Script Editor.

70 Q U I C K S T A R T
C H A P T E R 1 0 AD D IN G S C R IP T S

Attach scripts to the In the Resource Explorer, display the forms that have been defined for the
buttons in the dictionary. Double-click the Inventory_Maintenance form to open its Form
Inventory_Maintenance Definition window. With the Inventory_Maintenance window highlighted
window. in the Windows tab of the Form Definition window, click Open.

Add the Clear button First, add a script to the Clear button. The following steps describe how to
script. design and add the script for the Clear button:

1. Decide the function of the script.


The Clear Button script will clear the fields in the window but won’t
affect the information stored in the table in any way. After clearing, the
application should be ready to retrieve an item or accept a new entry.

2. Outline the steps to complete the task.

• Prepare the application to retrieve or accept new data.

• Clear the Inventory Maintenance window.

3. Decide where the script should be attached and when it


should run.

• The script should be attached to the Clear button.

• The script should run when the Clear button is clicked, so it will be
a change script.

4. Convert the outline of steps to sanScript.


In sanScript, the two steps should be written as shown. Each step is
described in a comment above the corresponding line. In sanScript, any
text bounded by braces ({}) is treated as a comment.

{Release the lock on any record currently in the table buffer.}


release table Inventory_Data;
{Prepare the form to accept new data.}
restart form;

The release table statement allows the application to read another item
from the table. The restart form statement clears the fields in the
window so they can accept new data.

QUICK START 71
PA RT 2 L E S S O N S

5. Attach the script.


Now you’ll enter the script and attach it to the Clear button.

Double-click the Clear button in the layout area. The Script Editor will
open. The script name will be entered automatically. Script names are
constructed from the current window name, field name and the script
type, such as CHG for a change script.

Enter the following script:

{Release the lock on any record currently in the table buffer.}


release table Inventory_Data;
{Prepare the form to accept new data.}
restart form;

The Script Editor window should resemble the following illustration:

Click Compile to verify and save the script. If there are no errors, click
Close to close the Script Editor window. The name of the script will
appear next to the Change property under the Script tab in the
Properties window, indicating a change script is attached to the push
button.

72 Q U I C K S T A R T
C H A P T E R 1 0 AD D IN G S C R IP T S

6. Save your changes and test the script.


Close the layout window and save the changes. Click OK in the Form
Definition window to save the form. Choose Test Mode from the Debug
menu. Enter some data in the Inventory application and click the Clear
button. The data you entered should be cleared from the window.
When you’ve finished testing, exit test mode by choosing Test Mode
from the Debug menu.

Add the Save button Next, design and add the script for the Save button using the same
script. procedure outlined for the Clear button.

1. Decide the function of the script.


The Save button script will save any information currently displayed in
the Inventory Maintenance window. If the required fields (Part Number
and Description) aren’t filled, the record won’t be saved and a message
will indicate that information must be entered in those fields.

2. Outline the steps to complete the task.

• Verify whether information has been entered in all required fields.

• Save the data that’s displayed in the window to the table.

• Ready the window to accept new data.

3. Decide where the script should be attached and when it


should be run.

• The script should be attached to the Save button.

• The script should run when the button is clicked, so the script will
be a change script.

4. Convert the outline of steps to sanScript.


In sanScript, the steps should be written as shown:
{Find out whether all required fields have been entered.}
if not required(form Inventory_Maintenance) then
{If not, display a warning.}
warning "Please enter all required fields.";
else
{If so, copy the current record to the table buffer.}
copy to table Inventory_Data;
{Then, save the record from the buffer to the table.}
save table Inventory_Data;
{Prepare the form to accept new data.}
restart form;
end if;

QUICK START 73
PA RT 2 L E S S O N S

The first part of the “if...end if” structure uses the required() function to
find out whether all the fields you specified as required have data in
them. If they don’t, a warning indicating this will appear. If the
required fields have been entered, the second part of the “if...end if”
structure copies the information in the fields from the window to the
table buffer, and then saves the information to the table and clears the
window.

5. Attach the script.


Now you’ll enter the script and attach it to the Save button.

In the Resource Explorer, display the forms in the dictionary. Double-


click the Inventory_Maintenance form; the Form Definition window
will appear. Open the Inventory_Maintenance window, and double-
click the Save button in the layout area to open the Script Editor
window. The script name will be entered automatically.

Enter the following script:

{Find out whether all required fields have been entered.}


if not required(form Inventory_Maintenance) then
{If not, display a warning.}
warning "Please enter all required fields.";
else
{If so, save the current record to the table buffer.}
copy to table Inventory_Data;
{Then, save the record from the buffer to the table.}
save table Inventory_Data;
{Prepare the form to accept new data.}
restart form;
end if;

Click Compile to verify and save the script. If no errors occur, click
Close to close the Script Editor window.

You will receive a warning indicating that a literal string was used. Literal
strings can cause problems with making international versions of an
application. For this sample application, it’s OK to include literal strings.

6. Save your changes and test the script.


Close the layout and Form Definition windows, saving changes. You
may wish to wait until you’ve finished the scripts for the other buttons
before you test this script, since you currently can’t retrieve the
information you’ve saved.

74 Q U I C K S T A R T
C H A P T E R 1 0 AD D IN G S C R IP T S

Add the Delete button Next, design and add the script for the Delete button using the same
script. procedure.

1. Decide the function of the script.


The Delete Button script should delete the currently-displayed item
from the table, after verifying that the user wants to delete the item. The
delete button shouldn’t work if there is no item to delete, so another
script is needed to disable the Delete button until an item is read from
the table.

2. Outline the steps to complete the task.

• Verify that the user wants to delete the item.

• Delete the item from the table.

3. Decide where the script should be attached and when it


should run.

• The script should be attached to the Delete button.

• The script should run when the Delete button is clicked, so the
script will be a change script.

4. Convert the outline of steps to sanScript.


In sanScript, the steps should be written as shown:

{Ask if the user wants to delete the current item.}


if ask("Delete this item?","Delete","Cancel","") = ASKBUTTON1 then
{If Delete is clicked, delete the record from the table.}
remove table Inventory_Data;
{Prepare the form to accept new data.}
restart form;
end if;

The “if...end if” structure uses the ask() function to verify that the user
wants to delete the item. ASKBUTTON1 is a predefined Dexterity
constant signifying the first button in the dialog box displayed by a
function such as ask(). If the user clicks the first button, Delete, the item
will be removed from the table and the Inventory Maintenance window
will be cleared. If the user clicks Cancel, the alert message dialog box
will close and no other action will be taken.

QUICK START 75
PA RT 2 L E S S O N S

5. Attach the script.


Now enter the script and attach it to the Delete button.

In the Resource Explorer, display the forms that have been defined for
the dictionary. Double-click Inventory_Maintenance form; the Form
Definition window will appear. Open the Inventory_Maintenance
window and double-click the Delete button in the layout area. The
Script Editor window will open and the script name will be entered
automatically.

Enter the following script:

{Ask if the user wants to delete the current item.}


if ask("Delete this item?","Delete","Cancel","") = ASKBUTTON1 then
{If Delete is clicked, delete the record from the table.}
remove table Inventory_Data;
{Prepare the form to accept new data.}
restart form;
end if;

Click Compile to verify and save the script. If no errors occur, click
Close to close the Script Editor window.

6. Save your changes and test the script.


Because there isn’t a way to retrieve information from the table yet,
you’ll have to test the delete script later.

Add the script to Since no testing can be done until items can be retrieved from the table, the
retrieve records. following script to retrieve information should be added next. Again, use
the same procedure to design and add the script.

1. Decide the function of the script.


This script should retrieve the information about an item when the
item’s part number is entered in the Part Number field. If an item is
retrieved from the table, the Delete button should be enabled so the
item can be deleted. You shouldn’t be able to change a part number for
a retrieved item.

2. Outline the steps to complete the task.

• Ascertain whether an item associated with the specified part num-


ber exists in the table.

• If the item exists, retrieve it.

76 Q U I C K S T A R T
C H A P T E R 1 0 AD D IN G S C R IP T S

• If an item is retrieved, enable the Delete button.

• In all cases, prevent the Part Number field from being modified.

3. Decide where the script should be attached and when it


should run.

• Because the script needs information from the Part Number field, it
should be attached there.

• The script should run when a new part number is entered (when
the Part Number field changes), so the script should be a change
script.

4. Convert the outline of steps to sanScript.


In sanScript, the steps should be written as shown:

{Set the value of the key field in the table buffer.}


'Part Number' of table Inventory_Data = 'Part Number' of window
➥ Inventory_Maintenance;
{Release the lock on any record currently in the table buffer.}
release table Inventory_Data;
{Attempt to retrieve the record from the table.}
change table Inventory_Data by Inventory_Data_Key1;

if err() = OKAY then


{If there was no error, the record was successfully read;
➥ Copy the record from the table buffer to the window.}
copy from table Inventory_Data;
{Clear the change flag for the Inventory_Maintenance form.}
clear changes form Inventory_Maintenance;
{Enable the Delete button because the retrieved record can
➥ be deleted.}
enable 'Delete Button';
end if;

{Prevent the Part Number field from being modified.}


lock 'Part Number';

Notice that field names that include spaces must be enclosed in single quotes to
compile properly.

QUICK START 77
PA RT 2 L E S S O N S

The first part of the script evaluates the part number entered and
attempts to retrieve a record from the table with that part number. The
second part of the script uses an “if...end if” structure to determine
whether there was a problem retrieving the item. If there were no
problems reading the table, this means an item was found and the
information is copied to the window. If there was a problem, the script
assumes the item couldn’t be retrieved because it doesn’t exist and the
window will be left empty to be filled in by the user.

5. Attach the script.


Now you’ll enter the script and attach it to the Part Number field.

The Inventory Maintenance window should already be open. Double-


click the Part Number field to open the Script Editor window and create
a change script. The script name will be entered automatically.

Enter the following script. The continuation character (➥) indicates that
the following text should be typed on the same line as the previous text.
Some of the statements are lengthy. You may have to scroll to the right
in the Script Editor window to see the text you enter.
{Set the value of the key field in the table buffer.}
'Part Number' of table Inventory_Data = 'Part Number' of window
➥ Inventory_Maintenance;
{Release the lock on any record currently in the table buffer.}
release table Inventory_Data;
{Attempt to retrieve the record from the table.}
change table Inventory_Data by Inventory_Data_Key1;

if err() = OKAY then


{If there was no error, the record was successfully read.
➥ Copy the record from the table buffer to the window.}
copy from table Inventory_Data;
{Clear the change flag for the Inventory_Maintenance form.}
clear changes form Inventory_Maintenance;
{Enable the Delete button because the retrieved record can
➥ be deleted.}
enable 'Delete Button';
end if;

{Prevent the Part Number field from being modified.}


lock 'Part Number';

Click Compile to verify and save the script. If no errors occur, click
Close to close the Script Editor window.

78 Q U I C K S T A R T
C H A P T E R 1 0 AD D IN G S C R IP T S

6. Save your changes and test the script.


Now that the Inventory application has a script to retrieve items from
the table, you can test the scripts for the Save and Delete buttons, as
well as for the Part Number field. Close the layout window and the
Form Definition window, saving your changes. Choose Test Mode from
the Debug menu, then open the Inventory Maintenance window. Enter
and save a few records, keeping track of the part numbers you’ve
entered. Then enter one of these part numbers in the Part Number field
and press the TAB key. The record for that part number should be
retrieved and displayed, and the Part Number field should be locked.
Check the delete function by deleting the part number and trying to
retrieve it. When you’ve finished testing the functions, exit test mode.

Add the window pre Now you’ll add the script to disable the Delete button that was mentioned
script. previously. Use the same procedure to design and add this script.

1. Decide the function of the script.


This script should disable the Delete button in the Inventory
Maintenance window until an item is retrieved from the table.

2. Outline the steps to complete the task.

• Disable the delete button.

3. Decide where the script should be attached and when it


should run.

• The best location to attach this script would be the Inventory Main-
tenance window itself, since the action isn’t the result of changing a
particular field or pushing a button.

• It should run when the window opens, so it will be a window pre


script.

4. Convert the outline of steps to sanScript.


In sanScript, the steps should be written as shown:

disable 'Delete Button';

This single statement disables the Delete button until the enable field
statement runs.

QUICK START 79
PA RT 2 L E S S O N S

5. Attach the script.


Now you’ll enter the script and attach it to the Inventory Maintenance
window.

In the Resource Explorer, display the forms that have been defined for
the dictionary. Double-click the Inventory_Maintenance form; the Form
Definition window will appear. Double-click the
Inventory_Maintenance window to open its layout window. With the
entire window selected, click the Script tab in the Properties window.
Double-click the Pre property to open the Script Editor window and
attach a pre script. The script name will be entered automatically.

Enter the following script:

disable 'Delete Button';

Click Compile to verify and save the script. If no errors occurred, click
Close to close the Script Editor window. The name of the script will
appear next to the Pre property, indicating that the script is attached.
Close the Window Layout window, saving your changes.

6. Save your changes and test the script.


Close the Form Definition window and the Forms window, saving
changes. Enter test mode to verify whether the Delete button is
disabled.

Add the window post One more issue must be addressed with a script. You’ve been closing the
script. Inventory Maintenance window using the close box. If you were entering
information and closed the window without having saved the current
entry, your information would be lost. A script that verifies whether the
information needs to be saved before the window closes would solve this
problem. The design and content for this script is given in the following
steps:

1. Decide the function of the script.


When the window is closed, this script should check whether any
changes were made to the current item. If so, a message should ask the
user if he or she wishes to save the changes. If the record is to be saved,
make sure all the required information is entered. Otherwise, just close
the window.

80 Q U I C K S T A R T
C H A P T E R 1 0 AD D IN G S C R IP T S

2. Outline the steps to complete the task.

• Check whether data displayed in the window changed.

• If so, verify whether the changes should be saved.

• If so, save the changes. If not, close the window.

3. Decide where the script should be attached and when it


should run.

• Because the script runs when the window closes, it should be


attached to the window.

• The script should run when the window closes, so the script will be
a window post script.

4. Convert the outline of steps to sanScript.


To ascertain whether any data displayed in the window has changed,
use the changed() function. This function reads the status of a
Dexterity-maintained variable called the Window Change Flag. If any
field for which the SetChangeFlag property is set to true has been
changed, the Window Change Flag will be set to true. In the Inventory
application, all fields have this property set to true by default.
Therefore, we can use the changed() function to see if any fields have
been changed.

In sanScript, the steps should be written as shown:

{Declare a local variable to store the result of the ask()


➥ function.}
local integer reply;

{Check the status of the window change flag for the


➥ Inventory_Maintenance window.}
if changed(window Inventory_Maintenance) then
{If something in the window has changed, ask if the changes
➥ should be saved.}
reply = ask("Save changes?","Yes","No","Cancel");
if reply = ASKBUTTON1 then
{If the answer is yes, verify that all required fields
➥ have been entered.}
if required(form Inventory_Maintenance) then

QUICK START 81
PA RT 2 L E S S O N S

{Copy the record to the table buffer, then save it to


➥ the table.}
copy to table Inventory_Data;
save table Inventory_Data;
else
{Display a warning to enter all required fields.}
warning "Please enter all required fields.";
abort close;
end if;
elseif reply = ASKBUTTON3 then
{User clicked Cancel. Don’t close the window.}
abort close;
end if;
end if;

The first part of the “if...end if” structure uses the changed() function to
see if any items in the inventory window have changed. If no changes
were made, the window will close. If changes were made, the ask()
function is used to check whether the user wants to save changes. If the
user clicks Yes, the same routine used in the save script checks whether
the required information has been entered, then it saves the data. If the
user clicks Cancel, the window remains open and unchanged.

5. Attach the script.


Now enter the script and attach it to the Inventory Maintenance
window.

Open the layout window for the Inventory_Maintenance window.


Click the Script tab in the Properties window, and double-click the Post
property to open the Script Editor window. The script name will be
entered automatically.

82 Q U I C K S T A R T
C H A P T E R 1 0 AD D IN G S C R IP T S

Enter the following script:


local integer reply;

{Check the status of the window change flag for the


➥ Inventory_Maintenance window.}
if changed(window Inventory_Maintenance) then
{If something in the window has changed, ask if the changes
➥ should be saved.}
reply = ask("Save changes?","Yes","No","Cancel");
if reply = ASKBUTTON1 then
{If the answer is yes, verify that all required fields
➥ have been entered.}
if required(form Inventory_Maintenance) then
{Copy the record to the table buffer, then save it.}
copy to table Inventory_Data;
save table Inventory_Data;
else
{Display a warning to enter all required fields.}
warning "Please enter all required fields.";
abort close;
end if;
elseif reply = ASKBUTTON3 then
{User clicked Cancel. Don’t close the window.}
abort close;
end if;
end if;

Click Compile to verify and save the script. If no errors occurred, click
Close to close the Script Editor window. The name of the script will
appear next to the Post property, indicating that the script is attached.
Close the Window Layout window, saving your changes.

6. Save your changes and test the script.


Close the layout window and the Form Definition window, saving
changes, and enter test mode. Open the Inventory Maintenance
window and enter data without saving it. Close the window to verify
that the window post script works properly. If you haven’t already
tested the window pre script, check whether the Delete button is
disabled when the window opens and enabled when an item is
retrieved. When you’ve finished, exit test mode.

In this chapter you’ve learned about pre, change and post scripts.
You’ve also learned how to attach scripts, how to use the Script Editor
window, and how to use some common sanScript commands.

QUICK START 83
84 Q U I C K S T A R T
Chapter 11: Creating a Lookup
Lookups allow a user to view multiple fields from multiple records in a
table. Usually, a user can select a record from a lookup and return it to the
window from which the lookup was accessed.

To easily display multiple lines of data from a table, lookups use scrolling
windows. Scrolling windows never appear by themselves in a Dexterity
application like primary windows. Like fields, they must be added to the
layout area of an existing window, where you can change how the scrolling
window will operate by setting the scrolling window’s properties or
attaching scripts to the window.

A scrolling window is linked to a table and displays one line of information


for each record in the table. You can display any field from a record, but
usually only the most important fields in each record are displayed in the
scrolling window. For example, the Inventory Lookup scrolling window in
the following illustration displays the Part Number and Description fields
from the Inventory_Data table. If a record in the lookup is selected, it is
returned to the Inventory_Maintenance window.

This is the scrolling


window, which appears
within a primary window.

Scroll bars are drawn


automatically for the
scrolling window.

QUICK START 85
PA RT 2 L E S S O N S

Lesson: Creating a Lookup


Before beginning this In this lesson, you’ll create a scrolling window to help you look up records
lesson, be sure your in the Inventory_Data table. You’ll also set up two different methods of
Inventory application is accessing the lookup window. The first method will be a push button added
working properly. Also, to the Inventory_Maintenance form. The second method will be to use the
you should have some Lookup menu item in the Help menu.
records saved in the
Inventory_Data table. Before you create the scrolling window, you’ll need to create a new form
and window into which you’ll place the scrolling window. To create the
new form, use the Resource Explorer window to display the forms that
have been created in the dictionary. Click the New button in the Resource
Explorer toolbar to open the Form Definition window.

Enter the following information without clicking OK:

Name Inventory_Lookup
Series 3rd Party

Create the Click the Tables tab, and then click Attach to link the Inventory_Data table
Inventory_Lookup to the form. The Table Lookup window will appear, containing a list of all
form. tables in the application. Select the Inventory_Data table and click OK. The
Table Lookup window will disappear, and the Form Definition window
should appear as shown in the following illustration.

86 Q U I C K S T A R T
C H A P T E R 1 1 C R E A T I N G A L O O K U P

Create the Click the Windows tab, and then click New to create a new window for the
Inventory_Lookup form. With the new window selected in the Window Layout window, set
window. the following properties under the Object tab in the Properties window:

AutoLinkTable Inventory_Data
AutoOpen True
CloseBox True
Name Inventory_Lookup
Title Inventory Lookup
WindowType Primary

Once you’ve set the above properties, click the Visual tab, and set the
following properties:

BackColor True
ControlArea False

Add the scrolling In the layout window, use the scrolling window tool to draw a scrolling
window to the layout. window as shown in the following illustration:

This is the scrolling


window tool.

QUICK START 87
PA RT 2 L E S S O N S

When you’ve drawn the scrolling window, the Scrolling Window Options
window appears automatically. Enter the following information in the
specified order. A Link Table must be specified before you can specify a
Link Key.

Scrolling Window Name Inventory_Lookup_Scroll


Link Table Inventory_Data
Link Key Inventory_Data_Key1

When you’ve finished, the Scrolling Window Options window should


appear as shown in the following illustration:

Click OK to save these options and close the window.


Open the layout Double-click the Inventory_Lookup_Scroll scrolling window in the layout
window for the area; a layout window for the scrolling window will open. A dotted line
scrolling window. appears approximately a quarter of an inch from the top of the window.
This marks the lower boundary of the small line item. Fields placed between
the dotted line and the top of the window will be repeated for each line in
the scrolling window when records are displayed at runtime.

You can move the small line item boundary by selecting Mark Small Line Item from
the Tools menu and then clicking the desired location in the scrolling window. For
the Inventory_Lookup_Scroll, you won’t have to move the small line item.

With the entire scrolling window selected in the layout area, set the
following properties under the Object tab in the Properties window:

DefaultDblClick True
WindowType Browse Only

These settings allow a user to double-click an entry in the scrolling window


to select that entry and close the window. They also prevent him or her
from editing any of the data appearing in the window.

88 Q U I C K S T A R T
C H A P T E R 1 1 C R E A T I N G A L O O K U P

Add the fields to the Drag the Part Number and Description fields from the list of global fields in
scrolling window. the Toolbox to the scrolling window and place them above the small line
item. You’ll need to resize the fields to fill the width of the entire line. When
you’ve finished, the layout area should appear as shown in the following
illustration.

Select both fields and set the following properties under the Visual tab:

Appearance 2D Border
Border False

When you’ve finished, close the layout window for the scrolling window
and save the changes.

Close the Window Layout window and the Form Definition windows,
saving changes to the new form and window. They must be saved before
you attach scripts. Reopen the Inventory_Lookup form and the
Inventory_Lookup window.

QUICK START 89
PA RT 2 L E S S O N S

Now you’ll add scripts to accommodate the scrolling window. A script


must be used to display data in the scrolling window. It would also be
useful if a user could display the item’s record in the Inventory
Maintenance window simply by selecting the item from the scrolling
window. One way to do this is to create a Select button that will transfer the
part number from the scrolling window to the Inventory Maintenance
window. You should also create a Cancel button to allow a user to cancel
the lookup.

Create the Select To create the Select button, click the Layout tab in the Toolbox, and select
button. Local Fields from the drop-down list in the center of the Toolbox. Click New
to open the Local Field Definition window, and enter the following
information:

Field Name Select Button


Array Size 0
Data Type Local
Control Type Push Button

Specify Text - Picture as the static type, and click the Static Values lookup
button. In the Button Items window, insert the following text for the Up
Caption:

Select

Click OK to save the text and close the Button Items window. Then click
Add to add the local field and leave the Local Field Definition window
open.

Create the Cancel Enter the following information to create another local field:
button.
Field Name Cancel Button
Array Size 0
Data Type Local
Control Type Push Button

Specify Text - Picture as the static type, and click the Static Values lookup
button. In the Button Items window, insert the following text for the Up
Caption:

Cancel

Click OK to save the text and close the Button Items window. Click OK to
save the new local field and close the Local Field Definition window.

90 Q U I C K S T A R T
C H A P T E R 1 1 C R E A T I N G A L O O K U P

Drag the local fields to the window layout, and use the line tool to draw the
separator line, as shown in the following illustration.

Attach a window pre Next you’ll attach scripts to the two new buttons and the window. With the
script. entire window selected in the layout area, click the Script tab in the
Properties window. Double-click the Pre property to open the Script Editor.
The script name will be entered automatically. Enter the following script:

fill window Inventory_Lookup_Scroll;

This script fills the scrolling window with information from the linked
table. Click Compile to verify and save the script. If no errors occur, click
Close to close the Script Editor window.

Attach a script to the Double-click the Select button in the layout area to open the Script Editor
Select button. window. The script name will be entered automatically. Enter the following
script:

return 'Part Number' of window Inventory_Lookup_Scroll;


close form Inventory_Lookup;

This script copies the part number of the item selected in the scrolling
window to the part number field of the Inventory Maintenance window so
the information can be retrieved. Click Compile to verify and save the
script. If no errors occur, click Close to close the Script Editor window.

QUICK START 91
PA RT 2 L E S S O N S

Attach a script to the Following the same procedure used for the Select button, apply the
Cancel button. following change script to the Cancel button:

close form Inventory_Lookup;

Click Compile to verify and save the script. If no errors occur, click Close to
close the Script Editor window.

Set the Select button to Select the Select button in the layout area. Click the Object tab in the
be the default. Properties window, and set the following property:

Default True

This property makes pressing the ENTER key, or double-clicking a line in the
scrolling window produce the same result as clicking the Select button.

To finish the scrolling window, choose Position Window from the Layout
menu. A window the same size as the Inventory_Lookup window will
open. Move it to the lower middle part of the screen and click OK. The
lookup window will open in that position at runtime.

Close the layout window and save your changes. Click OK to close the
Form Definition window.

Create the Lookup Now that you’ve created the lookup window to display all of the part
button. records entered in the sample application, you must create a mechanism to
open the lookup window. Most applications provide two ways to access the
lookup window. The first is a local push button on the Inventory
Maintenance window.

To create the push button, open the Inventory_Maintenance form and


Inventory_Maintenance window. With the Layout tab selected in the
Toolbox, choose Local Fields from the drop-down list. Click New to add a
new local field. In the Local Field Definition window, enter the following:

Field Name Lookup Button


Array Size 0
Data Type Local
Control Type Push Button

Specify Text - Picture as the static type, and then click the Static Values
lookup button. In the Button Items window, insert the following text for the
Up Caption:

92 Q U I C K S T A R T
C H A P T E R 1 1 C R E A T I N G A L O O K U P

Click OK to save the static value and close the Button Items window. Click
OK to save the new local field and close the Local Field Definition window.
Drag the local field to the window and place it to the right of the Part
Number field. Resize the button to a 20-pixel by 20-pixel square, using the
Size coordinates at the bottom of the Toolbox as a guide. The Inventory
window should resemble the following illustration.

Place the Lookup


button here.

Attach a script to the A script must be attached to the Lookup button to open the lookup
Lookup button. window. Double-click the Lookup Button field in the layout window to
open the Script Editor window and create a change script. Enter the
following script:

open form Inventory_Lookup return to 'Part Number';

Click Compile to verify and save the script. If no errors occur, click Close to
close the Script Editor window.

QUICK START 93
PA RT 2 L E S S O N S

Test the scrolling The scrolling window is now complete. Close all the windows and save
window. changes. Choose Test Mode from the Debug menu to test the lookup
window. When you click the Lookup button, the Inventory Lookup
window containing the scrolling window should appear, displaying
records for all the parts you entered. When you highlight one of the records
and click the Select button, the part should be displayed in the Inventory
Maintenance window. You also can select a part by double-clicking it or by
highlighting it and pressing ENTER. The Inventory Lookup window with the
sample data installed with Dexterity is shown in the following illustration:

When you’ve finished testing the scrolling window, exit test mode.

Associate the lookup The second method you’ll provide for accessing the lookup window will be
window with the Part to associate the Lookup item in the Help menu with Part Number field.
Number field. This causes the Inventory Lookup window to open if the Lookup menu
item is selected when the focus is on the Part Number field.

Lookups can be associated with fields using the Lookup Form field in the
Field Definition window or the Local Field Definition window. If a lookup
form has been designated for a global field, the Lookup menu item will
open the designated form if the focus is on any occurrence of that field in
the application.

In the Resource Explorer, display the fields that have been created in the
dictionary. Do this by selecting the Base category in the left pane of the
Resource Explorer, clicking the plus sign to expand the Base group, then
selecting the Fields item. Select the Part Number field and click Open.

94 Q U I C K S T A R T
C H A P T E R 1 1 C R E A T I N G A L O O K U P

The Field Definition window will open, as shown in the following


illustration:

Once a lookup form is Click this button


selected, its name will to open the Form
appear here. Lookup window.

Click the Lookup Form lookup button to open the Form Lookup window,
which contains a list of the forms in the Inventory application. Select
Inventory_Lookup from the list and click OK. Inventory_Lookup will
appear in the Lookup Form field in the Field Definition window. Click OK
to close the Field Definition window.

Test the Lookup menu Choose Test Mode from the Debug menu, and open the Inventory
item. Maintenance window. With the focus on the Part Number field, choose
Lookup from the Help menu. The Inventory Lookup window should
appear. Choose Test Mode from the Debug menu again to return to tools
mode.

In this chapter you learned to design and create a scrolling window. You’ve
also learned to access that scrolling window from a script attached to a push
button and from the Help menu’s Lookup item.

QUICK START 95
96 Q U I C K S T A R T
Chapter 12: Creating Menus
Refer to Chapter 14, Each form you create can have its own set of menu items that can be
“Form-based Menus,” accessed by the user at runtime. Menus are found across the top of the
in Volume 1 of the screen in your application’s menu bar. Each of the selections associated
Dexterity with a particular menu is called a menu item, and each menu item can have
Programmer’s Guide a script attached to it. The menus attached to a form appear only when a
for more information window attached to the form is active.
about using menus in
your application. This chapter will explain how to add the following menu to the Inventory
application.

QUICK START 97
PA RT 2 L E S S O N S

Lesson: Creating menus


This lesson will show you how to add a menu to the Inventory application
to easily compute the selling price for items. You set the selling price of
items in the Inventory Maintenance window, so this menu will be attached
to the Inventory_Maintenance form. Before you begin this lesson, the basic
Inventory application should be complete.

To begin adding the menu, use the Resource Explorer to display the forms
you created for the Inventory application. Open the Form Definition
window for the Inventory_Maintenance form. Click the Menus tab, and
then click New to open the Menu Definition window shown in the
following illustration.

This is the name used


to refer to the menu in
scripts.

The items in the menu


appear here.

Click New to create a


new menu item.

Add the Markup menu. Enter the following information in the Menu Definition window without
clicking OK:

Menu Name Markup


Display Name Mark&up

Click New to add a new menu item. Enter the following information:

Item Name &10%


Shortcut Ctrl+1

98 Q U I C K S T A R T
C H A P T E R 1 2 C R E A T I N G M E N U S

Click New to add another new menu item. Then enter the following
information:

Item Name &20%


Shortcut Ctrl+2

When you’ve finished, the Menu Definition window should look like the
following illustration:

Notice than an ampersand (&) is included in the menu’s display name and
in each of the menu items you entered. The ampersand signifies that the
character immediately following is to be used as an access key. Access key
characters will appear underlined at runtime.

An access key can be used in combination with the ALT key as a keyboard
equivalent. For example, the keyboard combination of ALT + U will display
the Markup menu, just as clicking the Markup item on the menu bar would.

Dexterity also allows you to create a second keyboard equivalent for menu
items, called a shortcut key. Shortcut keys can be used regardless of the
operating system used to run the application. For example, the 10% menu
item you just defined could be activated by the keyboard sequence CTRL + 1.

QUICK START 99
PA RT 2 L E S S O N S

Add scripts to the Next, you’ll attach scripts to the menu items. Select the 10% menu item and
menu items. choose Application Script as the action to perform. The Scripts button will
become enabled. Click the Scripts button to open the Script Editor window.
If you’ve selected the correct item, the following script name will be
automatically entered:

Inventory_Maintenance_MENU_Markup_ITEM_&10%

Enter the following script:

'Selling Price' of window Inventory_Maintenance = Cost of window


➥ Inventory_Maintenance + Cost of window Inventory_Maintenance/10;

This script adds 10% to the value in the Cost field and stores the result in
the Selling Price field. Click Compile to verify and save the script, and then
click Close to close the Script Editor window.

Using the same procedure, attach the following script to the 20% menu
item. If you’ve selected the correct item, the following script name will be
automatically entered:

Inventory_Maintenance_MENU_Markup_ITEM_&20%

Enter the following script:

'Selling Price' of window Inventory_Maintenance = Cost of window


➥ Inventory_Maintenance + Cost of window Inventory_Maintenance/5;

This script adds 20% to the values in the Cost field and stores the result in
the Selling Price field. Click Compile to verify and save the script, and then
click Close to close the Script Editor window. Click OK to save the menu
and close the Menu Definition window.

Before testing the menu, three other scripts must be added or modified in
the Inventory application. The items in the Markup menu should be
accessible only when the focus is on the Selling Price field. This prevents the
user from inadvertently changing the selling price. The window pre script
for the Inventory Maintenance window should be modified to disable the
menu items. A pre script should be added to the Selling Price field to enable
the menu items once the focus moves to the Selling Price field. Similarly, a
post script needs to be added to the field to disable the menu items when
the focus leaves the field.

100 Q U I C K S T A R T
C H A P T E R 1 2 C R E A T I N G M E N U S

Add statements to the The Form Definition window for the Inventory_Maintenance form should
window pre script. already be open. Click the Windows tab and open the
Inventory_Maintenance window. With the entire window selected, click the
Script tab in the Properties window. Double-click the Pre property to open
the Script Editor window and edit the existing window pre script, which
contains only one statement. Add the following statements to the end of the
script:

disable menu Markup 1;


disable menu Markup 2;

These statements disable the items in the Markup menu. Click Compile to
verify and save the script, and then click Close to close the Script Editor
window.

Add a pre script to the Select the Selling Price field in the layout area. Double-click the Pre
Selling Price field. property in the Properties window to attach a field pre script. Enter the
following script:

enable menu Markup 1;


enable menu Markup 2;

This script enables the two items in the Markup menu when the focus
moves to the Selling Price field. Click Compile to verify and save the script,
and then click Close to close the Script Editor window.

Add a post script to the Next, double-click the Post property to attach the following post script to
Selling Price field. the Selling Price field:

disable menu Markup 1;


disable menu Markup 2;

This script disables the two menu items when the focus leaves the Selling
Price field. Click Compile to verify and save the script, and then click Close
to close the Script Editor window.

Now you’re ready to test the menu. Close the layout window and the Form
Definition window. Be sure to save the changes, and then enter test mode.
Open the Inventory Maintenance window; you should see the Markup
menu on the menu bar. Both of the items in the menu should be disabled
(displayed in gray).

QUICK START 101


PA RT 2 L E S S O N S

Retrieve one of the items from the Inventory_Data table and move the focus
to the Selling Price field. The two items in the Markup menu should be
enabled. Choose 10% or 20% from the menu and note that the value in the
Selling Price field was calculated based upon the value in the Cost field and
the menu item you chose. When the focus leaves the Selling Price field, the
two menu items should be disabled.

If your application is functioning properly, choose Test Mode from the


Debug menu to return to tools mode.

In this chapter, you learned to how to add a menu to a form, how to create
shortcut keys and access keys for the menu, how to add scripts to menu
items, and how to enable and disable menu items.

102 Q U I C K S T A R T
Chapter 13: Creating a Report
For more information Dexterity has a built-in report writer that allows you to create reports based
about reports, refer to on the data in your application’s tables. This chapter covers the most basic
Chapter 32, “Report aspects of the Dexterity Report Writer. You’ll learn how to create a report,
Writer Overview,”, in design a report layout, and provide access to reports from within a
Volume 1 of the Dex- Dexterity application.
terity Programmer’s
Guide. The Dexterity Report Writer allows you to create reports and ship them
with your application dictionary. Refer to your Dexterity licensing
agreement for information about your access to the runtime version of the
Report Writer. Depending upon the terms of your agreement, you may be
able to send the runtime version of the Report Writer to your customers,
along with your application. This will allow them to create their own
reports, or modify those you’ve created.

Reports can contain numerous sections. The following table describes the
most commonly used report sections:

Section Description
PH Page Header. Items placed in the page header are printed at the top
of every page.
RH Report Header. Items placed in the report header are printed at the
beginning of every report, after the page header, if one is included on
the first page of the report.
B Body. Items placed in the body of the report are printed after all
headers have been printed.
RF Report Footer. Items placed in the report footer are printed at the end
of every report, after the body, but before the page footer, if one is
included on the last page of the report.
PF Page Footer. Items placed in the page footer are printed at the
bottom of every page.

QUICK START 103


PA RT 2 L E S S O N S

Lesson: Creating a Report


This lesson will show you how to create a report for the sample Inventory
application. The report will list all the inventory items, sorted by their
status. Before beginning this lesson, be sure you have some items saved in
the Inventory_Data table.

Be sure the Resource Explorer window is displayed. If it isn’t, click the


Open Resource Explorer button on the Dexterity toolbar to open it. Select
the Reports category in the left pane of the Resource Explorer. The right
pane of the Resource Explorer will display any reports that have been
created for the dictionary. Click New to create a new report; the Report
Definition window will appear. Enter the following information:

Report Name Inventory Report


Series 3rd Party
Main Table Inventory Data

Each report created using the Dexterity Report Writer must have one table
designated as its main table. This is usually the table that contains most of
the fields to be displayed in the report. Other tables for which relationships
have been defined with the main table may also be attached to a report, and
data in those tables may also be displayed in the report. Since the Inventory
application only has one table, selecting a main table for this report is an
easy choice.

When you select Inventory Data as the main table, the table’s only key is
automatically entered in the Using Key field.

Unmark the following check boxes in the Printing Options section:

First Page Header


Last Page Footer

By unmarking these check boxes, you prevent the Page Header and Page
Footer that you’ll define for the report from being printed on the first page
and last page of the report, respectively.

104 Q U I C K S T A R T
C H A P T E R 1 3 C R EA T IN G A R EP O R T

When you’ve finished, the Report Definition window should appear as


shown in the following illustration.

The display names of


each table defined in the
current dictionary are
listed here. When you
select one, its name
appears above the list.

Be sure you’ve unmarked


these options.

If a key for the main table won’t sort the report the way you want, Dexterity
allows you to create a different sorting order. Since the key for the Inventory
Data table contains only the Part Number field and we want to sort this
report by the Status field, we need to specify an alternate sorting order.

Specify the desired To specify the desired sorting order, click Sort in the Report Definition
sorting order. window. The Sorting Definition window will appear, allowing you to select
fields from any of the tables associated with the report as the fields upon
which the report will be sorted.

QUICK START 105


PA RT 2 L E S S O N S

The Report Name and Report Table fields will already be set. Select Status
in the Table Fields list and click Insert. The Sorting Definition window will
appear as follows:

Click OK to save the sorting order and close the window. Click Layout to
open the Report Layout window, shown below:

This tells you what type of


report you’re creating.

When a table name is


selected here, each field in
that table is listed below.

These labels indicate the


bottom of respective report
sections. You can resize a
section by dragging its label.

106 Q U I C K S T A R T
C H A P T E R 1 3 C R EA T IN G A R EP O R T

Add fields to the report Drag the following fields from the fields list to the layout area and place
layout. them in a row at the top of the body section:

Part Number
Description
Status
Cost
Selling Price

You may have to resize the Report Layout window and scroll horizontally
to place all the fields.

The blue guides mark the maximum text width for your current printer. To
make the fields in the layout fit within the guides, set the drawing options
for each field to use a 10-point font instead of a 12-point font. To do this,
select all the fields and choose Report Drawing Options from the Tools
menu; select a 10-point font and click OK to save your changes and close
the window. Adjust the width of each field to account for the smaller font.

After all of the fields have been arranged in the layout, resize the body
section by dragging its label up to the bottom of the fields to remove any
extra space. When you’ve finished, the layout should resemble the
following illustration.

QUICK START 107


PA RT 2 L E S S O N S

Add the report title, Now you need to add a header to display the report’s title, labels for each
labels and separator column of data that will appear on the report, and a line to separate the
line. labels from the data. Since this information should only appear on the first
page of the report, you’ll add it to the report header section.

Using the Text and Line tools, add a title, labels and the separator line to the
report header section as shown in the following illustration. Use the
Drawing Options window (displayed by choosing Report Drawing Options
from the Tools menu) to specify an appropriate font, style and color. Use the
tools on the Arrange tab to align the labels.

Add the page number In case the report spans multiple pages, you’ll need a way to label the order
to the page header. of the pages. This can be accomplished by including the page number on
each page of the report. Add the page number to the page header section.

Since the report header section you just defined appears on the first page only,
there’s no need for the page number to appear on the first page. That’s why you
unmarked the First Page Header option in the Report Definition window.

108 Q U I C K S T A R T
C H A P T E R 1 3 C R EA T IN G A R EP O R T

Select the Page Number tool from the Toolbox and place a page number in
the page header section. Use the Text tool to add the page number label.
When you’ve finished, the layout window should look like the following
illustration.

Close the layout window and save your changes. Click OK in the Report
Definition window to save the report.

Preview the report. Now you’ll preview the report. Select the Inventory Report in the Resource
Explorer. Choose Print Report in the Report Destination button drop list on
the Resource Explorer toolbar. The Report Destination window will appear.
Be sure only the Screen option is marked and click OK. After a few
moments, the report will be displayed on the screen.

QUICK START 109


PA RT 2 L E S S O N S

The following illustration shows the Inventory Report displaying the


sample data that was installed with Dexterity. Your report will contain the
data you entered while testing your application.

After you’ve looked at the report, close the Screen Output window. If
necessary, reopen the Report Layout window and make changes to the
report layout. When you’re satisfied with the report, close the Report
Definition window, saving your changes.

Attach a print script to Next you’ll need to provide a way for users to print the report from within
the Inventory_ the Inventory application. To do this, add a print script to the
Maintenance window. Inventory_Maintenance window.

Using the Resource Explorer, open the Inventory_Maintenance form, and


then open the Inventory_Maintenance window. With the entire window
selected in the layout area, click the Script tab in the Properties window.
Double-click the Print property to open the Script Editor window and
attach the following print script to the window:

run report 'Inventory Report';

Click Compile to verify and save the script. Click Close to close the Script
Editor window. Close the layout window for the Inventory_Maintenance
window, saving your changes. Close the Form Definition window.

110 Q U I C K S T A R T
C H A P T E R 1 3 C R EA T IN G A R EP O R T

Test the print script. Enter Test Mode and open the Inventory Maintenance window. When you
choose Print from the File menu, the Report Destination window should
appear, allowing you to choose where you want to print the report. Select
Screen or Printer and click OK; the report should print to the location you
specified. If your report printed properly, you’ve successfully re-created the
Inventory sample application.

In this chapter you’ve learned about the different sections of a report and
how to define a graphics report using the Report Definition window.
You’ve also learned how to create a sorting order for a report and how to
change the drawing options for text and graphical items, such as lines,
added to a report.

What to do next
You may want to develop a small Dexterity application on your own to
practice the concepts you learned in this manual. For more information
about specific Dexterity windows, search for the window’s title in the
online help. For more information on specific resources, refer to the chapter
on that resource in Volume 1 of the Dexterity Programmer’s Guide. For
more information about sanScript, refer to Volume 2 of the Dexterity
Programmer’s Guide. For information about specific sanScript commands,
refer to the SanScript Reference and the Function Library Reference.

If you’re developing applications that will link with other products, refer to
the Integration Guide to learn more about the programming standards and
conventions for integrating products. If you’re developing stand-alone
applications, refer to the Dexterity Stand-alone Application Guide. To learn
about the utilities available for Dexterity, refer to the Dexterity Utilities
manual.

QUICK START 111


112 Q U I C K S T A R T
Glossary Compile
To run a script through a compiler. A
Dictionary
A group of Dexterity resources that,
compiler translates the script instructions when interpreted by the runtime engine,
Access key into a language that the computer can present a complete functioning applica-
A key that can be used in combination understand. Once the script has been tion.
with the ALT key to active an item on the compiled, the instructions within the
menu bar, or a menu item. At runtime, an script can be executed. Disabled field
access key appears underlined. A field that is unavailable to or cannot be
Control type chosen by a user. A Delete button, for
AutoCopy property The main characteristic of a data type, example, should be disabled until the
A Dexterity feature that simplifies controlling the type of information that user selects an item to delete. A disabled
copying information between a table can be stored in fields with the data type, button or field appears dimmed.
buffer and a window. and some aspects of how the information
will be displayed. Commonly-used Drop-down list
AutoLinkTable property control types are push button, integer, A control type used to define data types
A Dexterity feature that allows the check box, date and currency. See also that allow users to select one item from a
Modifier to add fields to a window from Data type. list.
the auto-linked table. Each window can
have only one auto-linked table. Data type
A Dexterity resource that defines the
Browse-only scrolling window characteristics for a field, such as its A series of static text values will appear,
A scrolling window that allows the user keyable length, control type (push or “drop,” when a user clicks a field with
to browse through items in the window, button, check box, string and so on) and this control type.. The integer value
but not make any changes. format. A single data type can be applied corresponding to the position of the item
Buffer to several fields, but a field can have only chosen, not the item’s static text value, is
one data type applied to it. See also stored when the user’s selection is saved
A temporary storage area in a computer’s
Control type. to a table.
memory. See also Table buffer.
Data types are commonly identified by Editable field
Change flag
their control type or storage type; for A field whose contents can be changed
A boolean value associated with each
instance, a radio button data type, or a by the user.
form or window in an application. If the
string data type.
contents of the form or window change, Field
the change flag is set to true, indicating Default property A field contains a single piece of
the contents have changed. The status of A property that can be applied to a push information used by the application
the change flag is checked using the button window field. If this property is dictionary. A field can be displayed in a
changed() script function. set to True, pressing the ENTER key or window or stored in a table. The kind of
double-clicking a list box or scrolling information the field displays or stores
Change script
window with the DefaultDblClick depends upon the data type associated
A script that runs when the focus leaves a
property set to True causes the push with it. See also Global field and Local field.
field, if the information displayed in the
button’s change script to run.
field has changed. Change scripts are the Focus
most common type of script. See also Pre DefaultDblClick property The indicator that shows the object being
script and Post script. A property for list box fields, non-native controlled in the current window.
list box fields, and scrolling windows.
Check box Form
Double-clicking the list box or a line in a
A control type used to define data types A collection of windows, menus, scripts
scrolling window with this property set
that allow users to mark or unmark a and tables that function together for a
to True runs the change script for the field
selection. common purpose.
with the Default property set to True. See
also Default property.
Format
The extra characters, spacing and
Check boxes have boolean storage types. attributes that can be applied to a data
type when data is entered or displayed.

QUICK START 113


G L O S S A R Y

Format string size of the list box field when it’s added Modal window
A data “mask” used for string and to the layout window. An integer A window that contains no operating
composite formats. The format string position – not the static text – for the system controls and can’t be resized.
allows extra characters to appear in a corresponding selection in a list box is Modal windows are used when you
field without affecting the way data in stored when the selection is saved to a require the user to perform an action
the field is stored. table. before continuing.

Function Local field Modifier


A sanScript command that uses A field that’s available only within the A Dexterity tool that allows an
parameters and returns a value that must form in which it’s created. Local fields are application’s interface to be modified by
be used in an expression. used as window fields. See also Field and an end user. A Forms dictionary stores
Global field. these modifications.
Global field
A field created using the Field Definition Local variable Physical name
window. Global fields can be displayed A variable specific to a single script that For tables, the name under which a table
in windows or stored in tables. See also is active only while the script is running. is stored by the operating system or
Local field. Local variables are defined at the database.
beginning of the script.
Integrating application For global fields, a shortened version of
A Dexterity application that runs Lookup button the field name that is used as the column
concurrently with another product such A button used to open a lookup window. name when the field is used in a SQL
as Microsoft Dynamics GP. Typically, they appear with editable fields table.
to indicate that a lookup window is
Key available. The following illustration Post script
A field or combination of fields within a shows a typical lookup button. A script that runs upon closing a form or
record that is used as a basis by which to window or when the focus leaves a field.
store, retrieve and sort records. Typically post scripts save information to
tables and check for errors. See also
Key segment Change script and Pre script.
One field of a group of fields that Lookup form
compose a key. A form associated with a field that allows Pre script
users to view data from a table that may A script that runs immediately before a
Keyable length be entered in the field. It also allows the form or window is opened, or when the
The number of characters that can be user to select a value and return that focus moves to a field. See also Change
typed in a field. value to the field. script and Post script.
Layout window Main Menu form Primary window
A window in Dexterity that allows you to The first form that opens when an A window that appears with all
design the layout of a window, scrolling application dictionary is run. The form operating system controls, such as close
window or report. must use the name Main Menu, without boxes and resize controls. Most windows
any additional words or characters. used in applications are primary
List box
Stand-alone applications must have a windows.
A Dexterity control type used to define
Main Menu form.
data types that allow users to select one Property
static text value from a list. Menu An attribute that can be assigned to
One of the items displayed on the menu fields, windows or graphical objects
bar across the top of the screen. displayed in a window layout window.
For example, a window with the
Menu item Resizeable property set to False cannot be
One of the selections associated with a resized by the user at runtime.
particular menu.

The list will appear with scroll bars if the


information in the list is greater than the

114 Q U I C K S T A R T
G L O S S A R Y

Push button Scrolling window Table


A control type used to define data types A window used to display information A collection of related data formatted in
for buttons users can click to accomplish from a table. Scrolling windows allow the rows. Each row represents a separate
tasks. user to “scroll” through records in the record, and each column represents a
table. There are three types of scrolling separate field. Although this term
windows: browse-only, editable and originated with relational databases,
adds-allowed. Dexterity uses it generically to refer to
both relational database tables and ISAM
Static text or pictures can be used to Series database files.
indicate the button’s function. A predefined category to which you can
assign forms, tables and reports in your Table buffer
Record application dictionary. Series allow you A buffer that acts as an intermediate
A collection of data representing one to more easily organize these resources. storage area to hold one record from a
instance of each field in a table. table.
Shortcut key
Report Writer A key combination that will activate a Test mode
A Dexterity tool that allows you to menu item, equivalent to selecting the A Dexterity mode that allows you to
design and print reports for your item with the mouse. view and operate your application
application. dictionary as it will appear when used
Small line item with the runtime engine. See also Tools
Required field The area containing the fields that will be mode.
A field in which a value must be entered displayed when a scrolling window is in
to process information, such as an ID or standard mode. When a scrolling Toolbar
customer name. Fields are marked as window is in expanded mode, additional A type of window used for navigation in
required using the Required property. fields below the small line item mark, but Dexterity applications. Toolbars typically
above the big line item mark, will be appear across the top of the screen or
Required fields are displayed in a
displayed. A scrolling window’s mode is along the left side of the screen. Only one
different color or type style when a user
specified using the expand statement. tool bar window at a time can be
chooses the Show Required Fields menu
displayed in an application.
item. Stand-alone application
Resource A Dexterity application that operates Toolbox
without integrating with another A window that opens in conjunction with
An object such as a field, string, native
product. the Window Layout, Scrolling Window
picture, table, window or script that can
Layout and Report Layout windows. It
be used to create applications in Statement contains the tools used to place and
Dexterity. A script command used to complete a arrange items in the layout area.
Runtime engine specific action in an application, such as
running a report, opening a window or Tools mode
An application that’s used to interpret
saving an item to a table. A Dexterity development mode that
your dictionary. When a user starts your
allows you to edit or add resources to an
application, the runtime engine will use Static text value application dictionary. When you first
the resources in the dictionary to present Text that’s displayed as part of a data start Dexterity and open a dictionary, the
a functioning application. type, such as the name on a push button default mode is tools mode. See also Test
or the items in a list box. mode.
sanScript
The scripting language in Dexterity. String Window
A sequence of up to 255 ASCII characters. The work area used to enter and display
Script
A list of instructions an application uses Tab sequence information in an application.
to perform tasks. The order in which the focus moves from
one field to the next field when a user
presses the TAB key.

QUICK START 115


116 Q U I C K S T A R T
Index data types (continued)
adding static text to 29
fields (continued)
linking prompts
control types 27 illustration 63
A creating, lesson 26-32 local, described 37
access keys defined 113 lookup form 95
defined 113 described 25 physical names 38
described 99 naming conventions 27 positioning in a window 59
ampersands, in menus 99 Default, field property 92 properties 60
application dictionaries, see Dexterity tab sequence 62
dictionaries creating dictionaries 22 fill window statement 91
arrange tools, described 60 starting 9, 22 focus, defined 113
array fields, described 37 tool bar 23 Form Definition window 49
ask() function 75 dictionaries Format Definition window 33
AutoCopy, field property 113 creating 22 format strings, defined 114
AutoLinkTable, window property 58, defined 113 formats
113 disable menu statement 101 creating, lesson 34-36
disabled fields, defined 113 defined 113
B disabling described 33
body, described 103 fields 79 example 33
buffers, defined 113 menu items 100 fill option 35
Button Items window 31 display names, for tables 44 for currency data types 35
documentation forms
C organization 3 attached tables 50
change script symbols and conventions 5 creating, lesson 49-50
defined 113 drop-down lists, defined 113 defined 113
described 65 described 47
changed() function 81 E illustration 47
check boxes, defined 113 editable fields, defined 113 Main Menu form 48
compiling enable menu statement 101 main window, described 51
defined 113 enabling, menu items 101 table options 50
described 68 functions, defined 114
control types F
common, list of 27 Field Definition window 38 G
defined 113 field names 38 global fields
described 27 fields see also fields
conventions, in documentation 5 adding to reports 107 defined 114
creating, see individual topics adding to windows 60 described 37
currency arranging 60
data types 29 array fields 37 I
formats for 35 creating, lesson 37-40 if then...end if statement 77
defined 113 integrating applications, defined 114
D described 37 INVENT.DIC, see Inventory
data location, specifying with disabling 79 application
Pathname procedure 70 field names 38 Inventory application
data storage, in tables 41 global, described 37 adding records 14
Data Type Definition window 27 in tables, illustration 41 components of 11
data types linking prompts deleting records 17
see also control types described 62 function of 13

QUICK START 117


I N D E X

Inventory application (continued) local fields (continued) modal windows, defined 114
Inventory Lookup window 15, 85 creating 56 Modifier, defined 114
Inventory Maintenance window defined 114 mouse symbol 5
14, 58 described 37
Inventory Report, illustration 17, push buttons 56 N
110 local variables new symbol 5
Inventory report, printing 16 defined 114
Main Menu, illustration 14 in scripts 81 P
main window, illustration 55 lookup buttons page footers, described 103
Markup menu creating 92 page headers, described 103
illustration 97 defined 114 page numbers, adding to a report 108
using 16 position 92 palette windows, described 51
opening 10 lookup forms Pathname procedure, described 70
creating, lesson 86-95 physical names
K defined 114 defined 114
Key Definition window 46 described 85 for global fields 38
key segments, defined 114 for fields 95 for tables 44
keyable length, defined 114 opening, based on field definition positioning
keys 95 fields in reports 107
defined 114 returning data from 91 fields in windows 59-60
described 42 using scrolling windows 85 windows 58
for tables 46 Lookup menu item 94 post scripts
illustration 43 defined 114
M described 65
L Main Menu form pre scripts
launching, Dexterity 9 defined 114 defined 114
layout windows, defined 114 described 48 described 65
lessons main tables for reports 104 prerequisites, for learning Dexterity 4
Adding scripts 66-83 main window for forms 51 previewing
Creating a lookup 86-95 manuals, see documentation reports 109
Creating a report 104-111 margin notes 5 windows 58, 61
Creating a table 44-46 Menu Definition window 98 primary windows
Creating data types 26-32 menu items defined 114
Creating dictionaries 22-23 ampersands in names 99 described 51
Creating fields 37-40 defined 114 printing reports 109-110
Creating formats 34-36 disabling 100 procedures (resource), Pathname 70
Creating forms 49-50 enabling 101 product support, for Dexterity 6
Creating menus 98-102 menus programs, see dictionaries
Creating windows 52-63 access keys 99 prompts, linking to fields 62-63
light bulb symbol 5 ampersands in names 99 properties
line tool 61 creating, lesson 98-102 defined 114
linking prompts to fields 62-63 defined 114 for fields 60
list boxes described 97 for lines 61
defined 114 menu items 99 for scrolling windows 88
static values for 29 scripts 99 for text 55
Local Field Definition window 56 shortcut keys 99 for windows 54
local fields modal dialogs, described 51 Properties window 53
adding static text 56

118 Q U I C K S T A R T
I N D E X

push buttons sanScript (continued) series (continued)


defined 115 described 65 for tables 44
local 56 saving scripts 68 shortcut keys
static values for 31 screens, see windows defined 115
script editor, opening 66 described 99
R Script Editor window 67 small line item
records scripts defined 115
defined 115 adding, lesson 66-83 described 88
described 41 attaching, to push buttons 67 sorting, reports 105
illustration 41 change scripts Sorting Definition window 106
release table statement 71 defined 113 SQL symbol 5
Report Definition window 105 described 65 stand-alone applications, described 13
report footers, described 103 compiling starting, Dexterity 9
report headers, described 103 defined 113 statements, defined 115
Report Layout window 106, 107 described 68 static text values
Report Writer, defined 115 defined 115 adding to data types 29
reports disabling fields 79 defined 115
adding fields 107 filling scrolling windows 91 for list boxes 29
body, described 103 menu item scripts 99 for local fields 56
creating, lesson 104-111 overview 65 for push buttons 31
main table for report 104 post scripts Static Text Values window 30
overview 103 defined 114 static values
page footers, described 103 described 65 for data types 29
page headers, described 103 pre scripts for list boxes 29
page numbers 108 defined 114 for push buttons 31
parts of 103 described 65 storage, in tables 41
previewing 109 procedure for creating 71-73 String Definition window 57
printing 109-110 returning data from scrolling strings, defined 115
report footers, described 103 windows 91 support, available for Dexterity 6
report headers, described 103 saving 68 symbols in documentation 5
running from scripts 110 Script Editor 66
sorting order 105 window post script 80 T
required fields, defined 115 window pre script 79 tab sequence
required() function 73 Scrolling Window Options window 88 defined 115
Resource Explorer window 26, 32, 40 scrolling window tool 87 described 62
resources scrolling windows table buffers, defined 115
defined 115 adding to a window layout 87 Table Definition window 45
in the Inventory application 11 creating, lesson 86-95 Table Lookup window 50
restart form statement 71 defined 115 Table Options window 50
return statement 91 described 85 tables
run report statement 110 filling from linked table 91 adding to forms 50
runtime engine, defined 115 layout 89 as a data storage method 41
properties 88 concepts 41
S returning data from 91 creating, lesson 44-46
sample application, see Inventory small line item 88 defined 115
application series described 42
sanScript defined 115 display names 44
defined 115

QUICK START 119


I N D E X

tables (continued) windows (continued)


example 43 main window 51
fields 41 modal, defined 114
for reports 104 modal dialogs 51
illustration 42 naming 53
keys 42, 46 overview 51
overview 41 palettes 51
physical names 44 positioning 58
records 41 positioning fields 59
setting options 50 previewing 58, 61
structure, illustration 43 primary windows 51
technical support, for Dexterity 6 setting
test mode properties 54
defined 115 tab sequence 62
described 10 toolbars 51
switching to 10 windows in Dexterity
text Button Items 31
adding to a window 54 Data Type Definition 27
setting properties 55 Dexterity tool bar 23
tiling window fields 60 Field Definition 38
tool bars Form Definition 49
defined 115 Format Definition 33
illustration 23 Key Definition 46
toolbars, described 51 Local Field Definition 56
Toolbox Menu Definition 98
arrange tools 60 Properties 53
defined 115 Report Definition 105
described 53 Report Layout 106
layout tools 53 Resource Explorer 26, 32, 40
tools mode Script Editor 67
defined 115 Scrolling Window Options 88
described 10 Sorting Definition 106
switching to 10 Static Text Values 30
String Definition 57
W Table Definition 45
warning symbol 5 Table Lookup window 50
Window Change Flag 81 Table Options 50
window fields, setting properties 60 Toolbox 53
Window Layout window 53 Window Layout 53
windows
adding fields 60
adding text to 54
arranging fields 60
auto-link table 58
creating, lesson 52-63
defined 115
in Inventory application 11

120 Q U I C K S T A R T

You might also like