San Script Supplement
San Script Supplement
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the
rights under copyright, no part of this document may be reproduced, stored in or introduced into
a retrieval system, or transmitted in any form or by any means (electronic, mechanical,
photocopying, recording, or otherwise), or for any purpose, without the express written
permission of Microsoft Corporation. Notwithstanding the foregoing, the licensee of the software
with which this document was provided may make a reasonable number of copies of this
document solely for internal use.
Trademarks Microsoft, Dexterity, Microsoft Dynamics, and Windows are either registered trademarks or
trademarks of Microsoft Corporation or its affiliates in the United States and/or other countries.
FairCom and c-tree Plus are trademarks of FairCom Corporation and are registered in the United
States and other countries.
The names of actual companies and products mentioned herein may be trademarks or registered
marks - in the United States and/or other countries - of their respective owners.
Unless otherwise noted, the example companies, organizations, products, domain names, e-mail
addresses, logos, people, places, and events depicted herein are fictitious. No association with
any real company, organization, product, domain name, e-mail address, logo, person, place, or
event is intended or should be inferred.
Intellectual property Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
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.
Limitation of liability The content of this document is furnished for informational use only, is subject to change without
notice, and should not be construed as a commitment by Microsoft Corporation. Microsoft
Corporation assumes no responsibility or liability for any errors or inaccuracies that may appear
in this manual. Neither Microsoft Corporation nor anyone else who has been involved in the
creation, production or delivery of this documentation shall be liable for any indirect, incidental,
special, exemplary or consequential damages, including but not limited to any loss of anticipated
profit or benefits, resulting from the use of this documentation or sample code.
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.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T i
C O N T E N T S
check error............................................................................................................................................45
clear field ..............................................................................................................................................46
clear table .............................................................................................................................................47
countrecords()......................................................................................................................................48
day() ......................................................................................................................................................49
err()........................................................................................................................................................50
error.......................................................................................................................................................52
fill...........................................................................................................................................................53
for do...end for .....................................................................................................................................55
get ..........................................................................................................................................................56
hour() ....................................................................................................................................................57
if then...end if.......................................................................................................................................58
minute() ................................................................................................................................................59
mktime() ...............................................................................................................................................60
month() .................................................................................................................................................61
range .....................................................................................................................................................62
release table .........................................................................................................................................67
remove ..................................................................................................................................................68
repeat...until .........................................................................................................................................69
save table ..............................................................................................................................................70
second() ................................................................................................................................................71
set .........................................................................................................................................................72
setdate() ................................................................................................................................................73
str() ........................................................................................................................................................74
sysdate() ...............................................................................................................................................75
systime() ...............................................................................................................................................76
value() ...................................................................................................................................................77
warning ................................................................................................................................................78
while do...end while ...........................................................................................................................79
year() .....................................................................................................................................................80
Glossary ......................................................................................................................................................... 93
Index ................................................................................................................................................................... 95
ii C O N T I N U U M S A N S C R I PT S U PP L EM EN T
INTRODUCTION
Introduction
This supplement is intended for programmers who are not familiar with sanScript.
It contains information about core sanScript functionality used to create database-
level and process-level integrations with the Continuum API.
This supplement does not provide information about the Microsoft Dynamics GP
database structure and processes. The Microsoft Dynamics GP Software
Development Kit (SDK) contains that type of information. You will need the
information in the Microsoft Dynamics GP SDK to effectively integrate with
Microsoft Dynamics GP.
• Part 1, Scripting, introduces the sanScript language and explains how to use
sanScript in your Continuum integrations.
Symbol Description
The light bulb symbol indicates helpful tips, shortcuts
and suggestions.
Convention Description
Part 1, Getting Started Bold type indicates the name of a part.
Chapter 6, “Commands” Quotation marks indicate the name of a chapter.
Applying formats Italicized type indicates the name of a section.
set 'l_Item' to 1; This font is used for script examples.
Software Development Acronyms are spelled out the first time they’re used.
Kit (SDK)
TAB or ALT+M Small capital letters indicate a key or a key sequence.
2 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
PART 1: SCRIPTING
Part 1: Scripting
This part introduces sanScript and describes how to use it to create database-level
and process-level integrations with Continuum. The information is divided into the
following chapters:
• Chapter 2, “Working With Data,” describes how to use the various data types in
sanScript.
4 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
Chapter 1: sanScript
SanScript is the language used by the Dexterity® development system. It is a
powerful, English-like language that is designed to be easy to learn. The code for all
Dexterity-based applications like Microsoft Dynamics™ GP, is written in sanScript.
With the Continuum API, you have the ability to write a sanScript script and pass it
into Microsoft Dynamics GP where it will be compiled an executed. This pass-
through sanScript allows you to access the power of sanScript from within your
Continuum application.
• General syntax
• Names
• Statements
• Functions
• Data types
• Variables
• Constants
• Expressions
• Operators
• Arrays
• Composites
General syntax
SanScript is a relatively easy language to learn, but you must follow some basic
rules when you write scripts.
• SanScript is case-sensitive, as are names of fields, tables and other resources. All
keywords in sanScript must be lowercase.
• Each statement in a script must end with a semi-colon. Statements can span
multiple lines.
• If a script has local variables, these must be declared at the beginning of the
script before any other lines in the script.
Names
In a script, you will refer to the names of items such as fields and tables in the
Microsoft Dynamics GP application dictionary. The names of these items must be
fully qualified so the items can be properly located.
A qualified name consists of a qualifier, which specifies the location of the item, and
the item’s name. For example, to refer to the Customer Name field in the
RM_Customer_MSTR table, you would qualify the field with the name of the table
where the field is located. The fully-qualified name is shown in the following script.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 5
PA RT 1 S C R I P T I N G
When you reference an item whose name contains spaces, you must enclose the
name inside single quotation marks. The “of” portion of the name shouldn’t be
inside the quotation marks. The following name is valid:
Single and double quotation marks are used differently in scripts. Single quotation marks
indicate the names of objects, while double quotation marks indicate that the item between
the quotation marks is a string value.
Tables
When you refer to a table, you must use the table qualifier. For example, the
following sanScript code counts the number of records in the RM_Customer_MSTR
table.
Table fields
When you refer to a field in a table, you must specify the table in which the field is
located. For example, the following sanScript code refers to the Document Number
field in the RM_Sales_WORK table.
Statements
Statements are a type of command used in sanScript to complete a specific action in
your application, such as saving an item in a table. For instance, you will use the
save table statement to save a record in a table:
Functions
Functions are commands similar to statements, but unlike statements, they return a
value that is then used by another portion of the script. For example, the
countrecords() function counts the number of records in a table. The name of the
table is the function’s parameter while the number of records in the table is the
value returned. The following example sets the variable “number” to the number of
records in the RM_Customer_MSTR table.
6 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A P T E R 1 S A N S C R I P T
Data types
Dexterity uses several data types to specify how information is stored. When
writing scripts, it’s important to know how information in a field using a particular
data type is stored, so you will know how script commands will control the
information.
Fields store data in the following standard forms: boolean, currency, integer, long,
string, text, date and time. The following table lists each storage type, its
description, and the data types that use that storage type.
The other data types not mentioned in the previous table store information in a
format unique to the data type. Composite and multi-select list box data types each
store data in their own unique format.
Variables
Variables allow an application to temporarily store values used by the application.
SanScript has two types of variables: local variables and global variables.
Local variables
Local variables are specific to a single script and are active only while the script is
running. They’re used to store intermediate values, such as the resulting value of an
expression, while a script is running. To create local variables, define them at the
beginning of the script they’ll be used in. The word local, followed by the type of
variable (integer, long, currency, string, time, boolean) and the variable name are
required for each local variable.
Note that you use the word long to indicate a long integer type in scripts.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 7
PA RT 1 S C R I P T I N G
Global variables
Global variables are active the entire time the Microsoft Dynamics GP application is
open, so they’re available to any script at any time. Global variables are used to
store information that affects the entire application. To reference global variables in
a script, the qualifier of globals must appear after the name of the global variable.
In the following example, the global variable User ID is checked retrieved to see
who is currently logged into Microsoft Dynamics GP.
Constants
Constants are fixed numeric or string values that are used in scripts, where the
constant name is used in place of the value associated with it. Two types of
constants are available: predefined constants and user-defined constants.
Predefined constants
SanScript has a number of predefined constants that can be used in scripts. For
example, the three constants listed in the following table are associated with the
ask() function.
In the following example, the ask() function uses predefined constants to find out
which button the user clicked.
if ask("Include sales tax?”, “Yes”, “No") = ASKBUTTON1 then
set Total to Total + Tax;
end if;
User-defined constants
Microsoft Dynamics GP also has its own constants that were added when the
application was coded. For example, the following script retrieves the constant
corresponding to the number of periods.
local integer periods;
8 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A P T E R 1 S A N S C R I P T
Expressions
An expression is a sequence of operands and operators that are evaluated to return a
value. Operators indicate the type of procedure to perform on the operands. The
operands are usually items such as fields or the values returned from functions or
other expressions. There are four kinds of expressions in sanScript: numeric, date
and time, string, and boolean.
Numeric expressions
Evaluating a numeric expression results in numeric value. For instance, the
following sanScript statement uses a numeric expression that returns the total price
of a sale by adding the subtotal and sales_tax values.
The following table lists the numeric operators in the order they’re evaluated.
The following table lists the date and time operators in the order they’re evaluated.
String expressions
Evaluating a string expression results in a string value. For instance, the following
sanScript statement joins two string values and stores the result in the user_name
variable.
The following table lists the string operators in the order they’re evaluated.
Boolean expressions
Evaluating a boolean expression results in boolean value of true or false. Boolean
expressions are used in decision-making statements such as the if...then statement.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 9
PA RT 1 S C R I P T I N G
For instance, the following sanScript statement evaluates the boolean expression in
the if...then statement to find out whether the script should continue, based on who
the current user is.
The following table lists the boolean operators in the order they’re evaluated.
For example, multiplying the integers 450 and 75 should result in the value 33,750,
but instead results in -31,786. Because the actual result is larger than 32,767, the
maximum amount that can be represented by an integer, overflow occurs.
One method of preventing overflow is to convert all integer values in the expression
to long integers and then evaluate the expression. All integers in the expression, not
just the final result, must be converted to long integers to avoid overflow. This is
because the overflow can occur in intermediate steps while evaluating the
expression, not only the final step. For example, the expression in the following
script would still overflow:
To avoid the overflow, the two integer values must also be converted to long
integers as shown in the following script:
Operators
The following table lists the operators supported in sanScript. Examples are
included to show how each operator is used in the different types of expressions.
10 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A P T E R 1 S A N S C R I P T
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 11
PA RT 1 S C R I P T I N G
Arrays
The individual pieces that make up an array are called elements. The elements are
numbered from 1 to the size of the array. Arrays can have up to 32,767 elements. The
number used to indicate a specific element of the array is called the array index. A
specific element of the array is referenced in sanScript using its corresponding array
index.
Dexterity-based applications can use array fields and array local variables. Array
fields must have been created when the Dexterity-based application was coded.
Array local variables are created by including the size of the array in brackets – [ ] –
following the local variable name.
12 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A P T E R 1 S A N S C R I P T
To access the elements of an array from within a script, simply use the name of the
array and add the index number of the element you want to reference. Be sure the
index number is included in square brackets after the name of the array and before
the qualifier. The following example sets the second element of the History Figures
array to 5500.
The following example uses a local array field with five elements to act as status
flags for the script. The for loop initializes the flags to false.
for i = 1 to 5 do
set status[i] to false;
end for;
Composites
A composite is a special field that is actually composed of several individual fields.
Each part of the composite is called a component. Composites can be used to store
information such as account or item numbers, which are composed of several parts.
In sanScript, you can reference a composite field as a single entity. You can also
reference the value of a component within the composite field. Referencing
components of a composite is similar to referencing the elements of an array. The
components of a composite are numbered from 1 to the total number of components
in the composite. A specific component is referenced using the component keyword
followed by the number of the component enclosed in parentheses.
For example, the following script sets the local variable segment_2 to the value of
the second component of the Account Number composite field.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 13
14 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
Chapter 2: Working With Data
Whether you’re creating a database-level or process-level integration, you will need
to work with data in sanScript. This chapter describes how to convert data from one
type to another. It also describes data type conversions necessary when you pass
parameters to and from pass-through sanScript. Information is divided into the
following sections:
Implicit conversions
Type conversion happens implicitly in many situations. For instance, if an integer
value and a currency value are added together in an expression and the result is
stored in a currency field, the result would be a currency. If the result of the same
expression was stored in an integer field, the result would be an integer. The
conversions that occur depend on where the result is stored.
Explicit conversions
To explicitly convert a string to a numeric value, use the value() function. To
explicitly convert a numeric value to a string use the str() function. For more
information about each of these functions, refer to Chapter 5, “Functions and
Statements.”
Passing parameters
The parameter handler object allows you to pass strings between your Continuum
application and pass-through sanScript. If you want to pass other types of data,
such as integers or date values, you will need to perform explicit data type
conversions.
For example, assume you wanted to pass a date value from your Continuum
application into pass-through sanScript. To do this, your Continuum application
could divide the date into three strings, one containing the day, another the month
and a third the year. You would use the parameter handler object to pass these three
strings into pass-through sanScript. In sanScript, you would retrieve the three string
parameters, convert them to numeric values using the value() function, and create a
date value with the setdate() function.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 15
PA RT 1 S C R I P T I N G
For example, if you wanted to return a time value from pass-through sanScript, you
could use the hour(), minute(), and second() functions to retrieve the components
of the time value. You would then use the str() function to convert the values to
strings and then use the parameter handler object to pass them to your Continuum
application. Your Continuum application would them have to convert them back
into a time value.
16 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
Chapter 3: Database-level Integrations
When you create database-level integrations, you must work directly with
Microsoft Dynamics GP tables. This chapter contains information you need to
effectively work with tables in pass-through sanScript. The following topics are
discussed:
• Table buffers
• Common table operations
• Multiuser processing
• Ranges
• Records with the same key values
Table buffers
A buffer is a temporary storage area in your computer’s memory. Each time you
access a table from pass-through sanScript, a table buffer is created for the table. A
table buffer can hold one record of information. The information in the table buffer
comes from either the table or the script, depending on whether you’re reading a
record from the table or adding new information to the table.
Table
Tables are automatically opened when they are referenced in sanScript. They are closed when
the pass-through sanScript has finished.
• Retrieving a record
• Saving a new record
• Updating a record
• Removing a record
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 17
PA RT 1 S C R I P T I N G
Retrieving a record
Retrieving a record is a multi-step process. You must first decide which key you
want to use to retrieve the record. Use the Table Descriptions window in Microsoft
Dynamics GP to ascertain the keys and key segments for each table. Then set the
key field or fields and use the get or change statement to retrieve the record.
The following sanScript code retrieves the customer record for American Electrical.
The second key of the RM_Customer_MSTR table is composed of the Customer
Name field, so that key will be used to retrieve the record.
{Step 1: Set the key fields that will be used to retrieve the record.}
set 'Customer Name' of table RM_Customer_MSTR to "American Electrical";
{Step 2: Use the second key to retrieve the record. Don't lock the record.}
get table RM_Customer_MSTR by number 2;
18 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A PT E R 3 D AT A B AS E- LE V E L IN T E G R A T IO N S
Updating a record
To update an existing record, first read the record with the change statement. This
retrieves the record and locks it, allowing you to make changes. Then use the set
statement to make the changes to the appropriate fields in the record. Finally, use
the save table statement to save the changed record back to the table.
The following sanScript code reads the customer record for Adam Park Resort. The
Salesperson ID field is changed to STEVE K. Then the record is saved in the
RM_Customer_MSTR table.
{Step 1: Set the key fields that will be used to retrieve the record.}
set 'Customer Number' of table RM_Customer_MSTR to "ADAMPARK0001";
{Step 2: Use the first key to retrieve and lock the record, allowing it to be
changed.}
change table RM_Customer_MSTR by number 1;
Removing a record
To remove a record from a table, first read the record with the change statement.
This retrieves the record and locks it, allowing you to remove it with the remove
statement.
The following sanScript code reads the first record in the RM_Customer_MSTR
table and locks it. Then the remove statement removes the record from the table.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 19
PA RT 1 S C R I P T I N G
Multiuser processing
Microsoft Dynamics GP supports multiple users accessing the same table at the
same time. This is accomplished through Optimistic Concurrency Control (OCC), a
form of record locking that allows multiple users to work in the same tables and
access the same records with minimal restrictions, while helping to ensure data
integrity.
Record locking
A record must be locked to delete it or save any changes made to it. A lock is
applied when a record is read from a table. Two types of locks can be used: passive
and active.
Passive locking
A passive lock allows other users to access the record. They can delete the record or
make changes to it. Passive locking ensures that other users accessing the record can
be made aware that the record has been deleted or that the contents of the record
have changed. A passive lock is applied each time a record is read using the change
statement.
Active locking
An active lock allows other users to read the record, but not make any changes or
delete the record. Active locking ensures that the user who has the active lock is the
only user who can make changes or delete the record. If other users try to delete or
change the record, a table-sharing error will occur. An active lock is applied each
time a record is read using the change statement with the lock keyword included.
The get statement is used only to read a record. It never locks a record.
Not all tables in Microsoft Dynamics GP allow active locking. If your pass-through
sanScript code uses the change statement with the lock keyword on a table that
doesn’t allow active locking, you will receive a type incompatibility message.
Releasing locks
Any of the following actions releases a record lock:
• Using the save table or remove statements, regardless of whether the statement
is successful.
If a record is currently locked in a table buffer, and you attempt to lock another
record, you will receive an error message indicating that a record was already
locked.
20 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A PT E R 3 D AT A B AS E- LE V E L IN T E G R A T IO N S
The following table lists the various scenarios that can occur. The events listed
happen in order from left to right. For example, in the first row User A passively
locks a record, then User B passively locks the same record. User A deletes the
record, then User B changes the contents of the record and saves the record. The
changes User B made will be saved.
The err() function is used to trap errors so the script can deal with the errors that
occur. The following example scripts show how to trap for multiuser errors when
reading, saving and removing records. They use the err() function to trap and
handle errors.
You should not check for multiuser error conditions on tables containing text fields.
Multiuser error codes are not properly returned for tables containing text fields.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 21
PA RT 1 S C R I P T I N G
When you’re writing scripts that handle errors using the err() function, you may want to
use the check error statement as a debugging tool while you’re working. The check error
statement will display a message indicating the type of table error that occurred.
Example 1
The following script reads and actively locks the first record in the
RM_Sales_WORK table. It uses the err() function to handle an error resulting from
the record being actively locked by another user.
{Release the lock on any record currently in the table buffer.}
release table 'RM_Sales_WORK';
{Read the first record in the table and actively lock it.}
change first table RM_Sales_WORK, lock;
if err() = LOCKED then
{The record is actively locked by another user.}
warning "This record is currently locked by another user.";
end if;
Example 2
The following script reads the first record in the RM_Customer_MSTR table,
changes the Salesperson ID, and attempts to save the changed record. The err()
function is used to handle an error resulting from the record being changed or being
actively locked by another user.
{Release the lock on any record currently in the table buffer.}
release table 'RM_Sales_WORK';
22 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A PT E R 3 D AT A B AS E- LE V E L IN T E G R A T IO N S
Example 3
The following script reads the last record in the GL_Account_Category_MSTR table
and attempts to delete it. The err() function is used to handle an error resulting from
the record being actively locked or deleted by another user.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 23
PA RT 1 S C R I P T I N G
Ranges
When working with tables, it is often efficient to limit the amount of information
being accessed. You can do this by setting up a range for the table. A range is based
on a key for the table, and allows you to access a specified portion of the table. The
selected range will be treated as an entire table. For instance, a get first statement
returns the first record in the range, a get last statement returns the last record in the
range, and so on.
You use the range statement to create a range for a table. You can specify one range
per table, and the range is associated with a specific key. The range will be used only
when the table is accessed by the key the range is associated with.
Example 1
In the following example, the range statement is used to limit the records accessed
to only those customers whose names start with “A”. Notice that the second key for
the table, composed of the Customer Name field, is used for each of the range
statements as well as the get first statement.
Example 2
If a key is composed of several segments, you can create ranges based on several
key segments. The clear field and fill statements are often used when setting ranges
for multisegment keys. For example, the Purchase_Data table is shown in the
following illustration. It has a key composed of the Purchase Date and the Store ID.
24 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A PT E R 3 D AT A B AS E- LE V E L IN T E G R A T IO N S
The following script sets a range to include all purchases made on 11/17/98 for all
stores. The first segment of the key is set to the date 11/17/98. The second segment
is set to its minimum value using the clear field statement, then the start of the
range is set. The first segment remains 11/17/98. The second segment is set to its
maximum value using the fill statement. Then the end of the range is set. Using the
clear field and fill statements on the Store ID fields allows all stores to be selected.
{Clear any previous range for the table.}
range clear table Purchase_Data;
Example 3
The following example deletes all customer information for Aaron Fitz Electrical. A
single record must be deleted from the RM_Customer_MSTR and
RM_Customer_MSTR_SUM tables. Several records must be deleted from the
RM_Customer_MSTR_ADDR table. A range is used to delete these records.
{Delete the record from the RM_Customer_MSTR table.}
set 'Customer Number' of table RM_Customer_MSTR to "AARONFIT0001";
change table RM_Customer_MSTR by number 1;
if err() = OKAY then
remove table RM_Customer_MSTR;
end if;
{Set the beginning of the range. The key has two segments. They are the
Customer Number and the Address Code.}
set 'Customer Number' of table RM_Customer_MSTR_ADDR to "AARONFIT0001";
clear field 'Address Code' of table RM_Customer_MSTR_ADDR;
range start table RM_Customer_MSTR_ADDR by number 1;
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 25
PA RT 1 S C R I P T I N G
Range types
How a range is evaluated depends on the database manager used for the table. For
the Btrieve and c-tree database managers, ranges are evaluated inclusively. For the
SQL database manager, ranges are evaluated either inclusively or exclusively.
Example 4
The following example illustrates the difference between these two methods of
evaluating a range. The sample table shown in the following illustration has a key
composed of the three segments shown.
Range start: A A A
Range end: A C B
26 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A PT E R 3 D AT A B AS E- LE V E L IN T E G R A T IO N S
Notice that inclusive and exclusive ranges don’t contain the same records. This is an
issue when developing an application, because the c-tree database manager always
produce inclusive ranges, but the SQL database manager has optimal performance
when it produces exclusive ranges. The SQL database manager can be forced to
produce inclusive ranges, but the application’s performance may be seriously
degraded. To eliminate the discrepancies that result from the two types of ranges,
we recommend that you create “well-behaved” ranges in your sanScript code.
“Well-behaved” ranges
A “well-behaved” range has the following characteristics:
1. Beginning with the leftmost key segment and working to the right, the first 0 to
n segments are set to equal values for both the range start and the range end.
2. The next 0 or 1 segments are set to non-equal values for the range start and
range end.
3. The remaining segments (if any) are cleared for the range start and filled for the
range end.
The scripts in Examples 1, 2 and 3 all create “well-behaved” ranges. The ranges produced
will be the same, regardless of the database manager being used.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 27
PA RT 1 S C R I P T I N G
Schulz Dan
Smith Alan
Smith Maria
Smith Bob
Smith Sharon
Thompson Jean
Wallace Phill
Adding records
To allow multiple records to have the same key value, the table must allow
duplicates. Not all tables in Microsoft Dynamics GP allow duplicate records. If you
add a duplicate record to a table that doesn’t allow them, you will receive an error
indicating a duplicate record was created. Use the err() function to trap for this error
condition.
Retrieving records
It’s more difficult to retrieve records that have the same key value from a table. The
standard practice of setting the table buffer to the key value and then using a get or
change statement won’t work because the database manager can’t guarantee which
record will be retrieved. For example, if the table buffer for the table shown in the
previous illustration was set to “Smith” and a get or change statement was used to
retrieve a record, the table buffer could contain the record for Alan, Maria, Bob or
Sharon Smith. There is no way of knowing which record will be read.
Two methods can be used to reliably retrieve records that have the same key value.
• Start at the beginning of the table using the get first or change first statement.
Then use get next or change next statements to read all of the records in the
table. Be sure you’re using the same key for the get first or change first and get
next or change next statements.
This method will read all of the records in the table, including those that have
the same key value. However, there is no way of determining the order in
which the records having the same key value will be read.
• Use the range start statement to set the beginning of the range to the duplicate
key value, and use the range end statement to set the end of the range to the
duplicate key value. Use the get first or change first statement to retrieve the
first record in the range. Then use the get next or change next statement to
retrieve successive records from the range. Be sure you’re using the same key for
the range and get or change statements.
This method will read all of the records that have the same key value specified
using the range statements. However, there is still no way of determining the
order in which the records having the same key value will be read.
28 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A PT E R 3 D AT A B AS E- LE V E L IN T E G R A T IO N S
The following script reads all of the “Smiths” from the example table. The range
statements allow the table to access only records with the key value “Smith.” The
get first and get next statements read all of records from the range in the table. Note
that the same key is used for all of the range and get statements.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 29
30 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
Chapter 4: Process-level Integrations
When you create process-level integrations, you will call procedures and functions
in Microsoft Dynamics GP. This chapter contains information you need to use
Microsoft Dynamics GP procedures and functions from pass-through sanScript. The
following topics are discussed:
• Procedures
• Form procedures
• Background processing
• User-defined functions
Procedures
A procedure is a script that provides functionality common to several parts of a
Dexterity-based application. Procedures are called from other scripts in an
application. When a procedure is called from another script, the two scripts
involved have specific roles:
• The calling script is the script that accesses, or calls, the procedure. For
Continuum, the pass-through sanScript is always the calling script.
• The called script is the procedure that is invoked by the calling script.
A set of parameters can be used to pass data to the called script or return data to the
calling script.
Calling procedures
The call statement temporarily transfers control to a procedure, passing an optional
set of parameters. The syntax of the statement is shown below:
Parameters
Procedures operate by passing parameters between the calling script and the
procedure. The procedure uses the information in these parameters to work with
variables, fields and tables, and to return values to the calling script. Three types of
parameters can be used, as shown in the following illustration.
in
out
inout
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 31
PA RT 1 S C R I P T I N G
Parameters are classified according to how they are used when the calling script
communicates with the called script. The following table describes the different
types:
Procedures allow up to 255 parameters to be passed between the calling script and
the procedure. The types of the parameters defined for the procedure must match
the types of the parameters passed from the calling script. For example, if the calling
script passes an integer parameter to the procedure, the procedure must be set up to
receive an integer as a parameter.
Typically, the parameters passed to and from a procedure have one of the standard
storage types: boolean, currency, date, integer, long, string and time. Some
procedures also use existing global field definitions to declare parameter types. This
second method, described in the next section, is used when passing items such as
composites to a procedure.
The following example shows how a global field is used to specify a parameter
type. The script calls the Verify_Account_Type procedure to verify account type
information for a specified account. The procedure takes an Account Number as
one of its parameters. The Account Number global field is used to specify the type
of the account_number local variable.
{Account number}
local 'Account Number' account_number;
{Status flags}
local boolean account_status;
local boolean abnormal_termination;
32 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A P T E R 4 P R O C E S S - LE V E L IN T E G R A T IO N S
Form procedures
Form procedures are functionally the same as standard procedures, except they’re
associated with a specific form. Form procedures are used to group procedures that
perform tasks associated with a specific form in Microsoft Dynamics GP. Form
procedures are called like standard procedures, except that the of form form_name
clause must be included in the call statement.
Background processing
Background processing allows a procedure to run while other processing is
occurring, such as opening windows, printing reports and so on. To run a procedure
in the background, include the background keyword in the call statement. This will
add the procedure to a processing queue that will process it when time is available.
Procedures like posting are often run in the background.
You can monitor the progress of background procedures by using the Process
Monitor in Microsoft Dynamics GP. Background procedures must be completed
before you exit Microsoft Dynamics GP. If you attempt to exit Microsoft Dynamics
GP when a background procedure is running, a message will alert you that
background processes are still running.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 33
PA RT 1 S C R I P T I N G
User-defined functions
Microsoft Dynamics GP contains several user-defined functions. You can use these
user-defined functions in your pass-through sanScript the same way you use built-
in functions such as mktime().
The following example shows how to call a form-level function. The script calls the
IsDupAccountNumber() function of the GL_Copy/Move_Accounts form to verify
whether an account already exists.
34 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
PART 2: SANSCRIPT REFERENCE
Part 2: sanScript Reference
This portion of the manual contains reference information for the sanScript
language. The information is divided into the following chapters:
• Chapter 6, “Data types,”describes the various data types used in sanScript and
provides information about how to work with them.
• Chapter 7, “Alert Messages,” describes the compiler and runtime messages that
can occur when you use pass-through sanScript.
36 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
Chapter 5: Functions and Statements
This chapter contains descriptions of the functions and statements used for process-
level and database-level integrations. First, the functions and statements are listed
in a table by their usage. Later, each is listed again in alphabetical order, with a
detailed description, syntax, parameter list, and example of its use.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 37
Category Command Description
Time hour() Retrieves the hours portion of a given time.
minute() Retrieves the minutes portion of a given time.
mktime() Creates a time value from a given set of numbers.
second() Retrieves the seconds portion of a given time.
systime() Returns the current time from the current computer.
Command syntax
The syntax descriptions throughout this manual use the following standards:
• A vertical bar (|) between two or more items should be read as “or,” and indi-
cates that one item in the list should be chosen.
• Braces {} indicate optional items. If the braces enclose a group of items, one of
the items can be chosen.
• Square brackets [] list a group of items in which one choice is required. In rare
cases where they are part of the command syntax, they’re set in bold text.
• Ellipses (...) indicate that other commands can appear between the keywords of
the command being described.
Programming style
• Script examples are shown in Courier type.
• Comments describing a line of the script appear above or beside the corre-
sponding line and are enclosed in braces. A sample script statement with a com-
ment is shown below:
• A continuation character (➥) indicates that a script continued from one line to
the next in the manual should be typed as one line.
Command reference
The remainder of this chapter lists the sanScript commands that are typically used
in pass-through sanScript for Continuum integrations.
38 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
A B O R T S C R I P T
abort script
Description The abort script statement stops the current script.
Parameters • None
Comments The abort script statement is used to handle error conditions by stopping a script.
Example This script will be stopped if the values in the Debit and Credit variables aren’t
equal.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 39
A S K ()
ask()
Description The ask() function creates a dialog box that contains a message and up to three user-
defined buttons. It returns a value that indicates which button is clicked by the user.
Parameters • prompt – A string that contains the message you want to display in the dialog box.
• button1 – A string that contains the label for the first button in the dialog box.
• button2 – A string that contains the label for the second button in the dialog box.
• button3 – A string that contains the label for the third button in the dialog box.
Return value An integer that indicates which button the user clicked. It corresponds to one of the
following constants: ASKBUTTON1, ASKBUTTON2 or ASKBUTTON3.
Comments The string value entered as the prompt parameter provides the message for the
dialog box, and the buttons are labeled with the strings entered as the button1,
button2 and button3 parameters. If you want to use fewer than three buttons, use a
set of double quotation marks ("") for any buttons you don’t want to use.
Example The following script asks the user whether the changes to the current customer
record should be saved.
40 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C A L L
call
Description The call statement transfers temporary control to a procedure.
Syntax call {background} procedure {of form form_name}{, parameter, parameter, ...}
Parameters • background – Specifies whether the procedure will be processed in the background.
Certain Microsoft Dynamics GP procedures, such as posting, are performed in the
background.
• parameter – Values, such as tables or fields you wish to pass to or return from the
procedure. Up to 255 parameters can be passed to or returned from the called
procedure.
Comments The call statement transfers temporary control to a procedure, passing information
to it. If the background keyword is used, the called procedure is queued for
execution in the background. If that background procedure calls another procedure,
that procedure will also be run in the background. If the background keyword is
not used, the called procedure can pass information back to the calling script.
You can’t pass a table buffer when calling a procedure to run in the background
because the pass-through sanScript might have finished running before the
background procedure is run. In such a case, there would be no table buffer for the
procedure to use. Similarly, you can’t pass a temporary table to a background
procedure, since the temporary table may no longer exist when the background
procedure is processed.
You can monitor the process of procedures by using the Process Monitor in
Microsoft Dynamics GP.
if status = false
warning "Unable to get a journal entry.";
end if;
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 41
C A S E . .. E N D C A S E
case...end case
Description The case...end case statement allows a series of statements to run on a conditional
basis, much like the if then...end if statement.
Syntax case exp in [value] statements {in [value] statements} {else statements} end case
• in [value] – The value can be a single value or a range of values that the exp
parameter can be equal to. The value must be enclosed in brackets. Use the word
“to” to express a value range, such as “1 to 10”. The value for the expression “A or
B” can be written as “A, B”.
• else – If the else clause is included, then the statements following it will be run if all
of the in [] clauses have been evaluated as false.
Comments If multiple in [] clauses are included, the statements after the first in [] clause to be
evaluated as true will be run, and subsequent clauses will not be evaluated.
If none of the in [] clauses are evaluated to be true and an else clause isn’t included,
then no statements will be run until those listed after the end case statement.
Example The following example uses the case...end case statement to set the rebate amount
to be paid to customers based on their total year-to-date sales.
42 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A N G E
change
Description The change statement reads a record from a table and passively or actively locks the
record, allowing changes to be made to the table.
next
prev by key_name
Syntax change table table_name {, lock}{, wait}{, refresh}
first by number expr
last
Parameters • next | prev | first | last – Identifies which record to retrieve.
If none of these keywords are included, the record that matches the key value in the
table buffer will be retrieved. The next keyword will retrieve the record that follows
the key value currently in the table buffer. The prev keyword will retrieve the record
preceding the key value in the table buffer. The first keyword will retrieve the first
record in the table or range. The last keyword will retrieve the last record in the
table or range.
• by key_name | by number expr – Identifies the key by which you’ll search the table
to locate the record to be retrieved. If one of these parameters isn’t included, the first
key will be used.
You can identify the key by its name or by the key number. In the by key_name
parameter, key_name is the key’s technical name. In the by number expr parameter,
expr is an integer containing the number of the key, determined by its position in the
table definition. For instance, the third key created can be identified by the number
3, and so on.
• lock – Indicates that the record will be actively locked, and no other users will be
allowed to change or delete the record. If this option isn’t included, the record will
be passively locked.
Not all tables in Microsoft Dynamics GP support active locking. If you use the lock
keyword for a table that doesn't support active locking, you will receive a type
incompatibility message when you compile the pass-through sanScript.
• refresh – This keyword applies only for SQL tables. When a change statement reads
a SQL table, a record is actually read from an in-memory buffer. The refresh
keyword refreshes the records in the buffer before the read operation occurs,
ensuring that the most-current data will be read.
Comments The values of the key fields should be set in the table buffer before the change
statement is issued. You don’t need to set any fields in the table buffer to retrieve the
first or the last record in a table.
You can use the err() function or the check error statement to handle any errors that
may have occurred.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 43
C H A N G E
Example The following example uses the set statement to copy a key value, Customer
Number, from the parameter handler object. The change statement then uses the
value in the table buffer to retrieve a record from the RM_Customer_MSTR table
and place it in the table buffer. If the retrieval is successful, the credit limit amount
for the customer is set to 50000 and the customer record is saved.
Additional information
Chapter 3, “Database-level Integrations”
44 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H E C K E R R O R
check error
Description The check error statement checks the result of the last operation on the specified
table, and displays a corresponding message if there was an error. If no table name
is specified, it checks the result of the last table operation.
Parameters • table table_name – An optional clause specifying the name of the table for which you
want to check the last table operation.
Examples In the following example, a record is being retrieved from the RM_Customer_MSTR
table. The check error statement checks whether any errors occurred as the record
was being retrieved. An appropriate alert message is displayed if an error occurred.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 45
C L E A R F I E L D
clear field
Description The clear field statement clears one or more fields.
Parameters • field_name – The name of the field to be cleared. If you have multiple fields to clear,
list the name of each field separated by a comma.
Comments Clearing a field removes the data currently in the field. Be sure to fully qualify the
field or fields you are clearing.
If a table is not open when a field in that table is cleared, the clear field statement
will open the table.
Example The following example clears two fields in the table buffer for the
RM_Customer_MSTR table.
46 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C L E A R T A B L E
clear table
Description The clear table statement clears a table buffer.
Parameters • table_name – The name of the table for which the table buffer should be cleared.
Comments Clearing a table removes the data currently in its table buffer. It doesn’t remove data
from the actual table.
Example The following example clears the table buffer for the RM_Customer_MSTR table.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 47
C O U N T R E C O R D S ( )
countrecords()
Description The countrecords() function returns the number of records in the specified table.
Parameters • table table_name – The name of the table you want to count records in.
Comments This function can also be used to retrieve an estimate of the number of records in a
range.
Example The following example sets a local variable named customer_count to the number
of records in the RM_Customer_MSTR table.
48 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
D A Y ()
day()
Description The day() function returns the day of the month in a given date.
Syntax day(date)
Return value An integer between 1 and the maximum number of days in the month.
Example The following example sets a local variable named day_of_month to the number of
the current day in the system date.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 49
E R R ( )
err()
Description The err() function returns the result of the last operation on a specified table. If no
table name is specified, it will return the result of the last table operation regardless
of which table it was performed on.
Parameters • table table_name – The name of table you want to check the last error for.
Comments The err() function is often used in an if...end if structure that follows a table
operation (get, change, save table and so on) to handle any errors that may have
occurred during the operation. Using the err() function allows a script to detect
errors, respond accordingly and specify whether to notify the user. In contrast,
using the check error statement after table operations will automatically display an
alert message notifying the user that an error occurred, but doesn’t provide a
method for the script to respond to the error.
Some of the return values from the err() function correspond to predefined
constants, allowing you to use the constant in place of the error number. The
following table lists common operation errors, and their associated error values and
constants.
The following table lists other operation errors and their associated error values.
While no constants have been associated with these error values, they are valid
values that can be returned by the err() function.
50 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
E R R ()
Examples The following script attempts to save the current record to the
RM_Customer_MSTR table. The err() function is used to find out whether another
user has changed the record. If the record has been changed, an error message is
displayed indicating the situation to the user.
The following example retrieves each record from the RM_Customer_MSTR table
and sets the Salesperson ID field to STEVE K. The err() function is used to check for
any errors that occurred during processing.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 51
E R R O R
error
Description The error statement creates an error dialog box displaying the specified string. The
dialog box will have one button labeled OK.
Parameters • expression – A string field, text field, or string or text value with the message to be
displayed in the dialog box.
Example The following example generates an error message for the user.
52 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
F I L L
fill
Description The fill statement sets a field to the largest value represented by the field’s data
type, regardless of any keyable length or format applied to the field. For example,
an integer field would be filled with the number 32,767.
Comments The fill statement is useful for setting ranges of information to be displayed from a
table.
You can fill multiple fields using one fill statement, by listing each field name
separated by a comma.
The following table lists the storage types for which the fill statement can be used,
and the value with which the field will be filled:
Fields with date or time control types will be displayed using the format specified
for their data types. For example, a filled time field might be displayed as 12:59:59
PM.
If the table containing the field to be filled is not open, the fill statement will open
the table.
Example The following example uses the fill statement to set the range for the Invoice table.
The Invoice table is composed of records that contain the key fields
Invoice_Number and Item_Number as shown in the following illustration:
Invoice
Invoice
Invoice
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 53
F I L L
The number of items included in each invoice isn’t known. The following script
uses the range statement and the fill statement to set the range so only the items for
Invoice 10002 will be accessed.
54 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
F O R D O .. . E N D F O R
Syntax for index = expr1 to expr2 {by step_expr} do statements end for
Parameters • index – An integer variable used to keep track of the current number of repetitions of
the loop. This variable for the loop index must be declared separately.
• expr1 – An integer value that’s the minimum value of index. The count will start at
this number.
• expr2 – An integer value that’s the maximum value of index. The for loop will stop
counting when index passes this number.
• by step_expr – The integer that specifies the amount by which the index variable will
be incremented during each pass through the loop. Only positive step values are
supported at this time. If this increment amount isn’t stated, the loop will be
incremented by one at each repetition.
Example The following example sets the elements of the YTD_Sales array field to 0.
for i = 1 to 12 do
set YTD_Sales[i] to 0;
end for;
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 55
G E T
get
Description The get statement retrieves a record from the table without locking the record. You
can’t change the data in a record that has been retrieved with the get statement.
next
prev by key_name
Syntax get table table_name {,refresh}
first by number expr
last
Parameters • next | prev | first | last – Identifies which record you want to retrieve. If none of
these keywords are included, the record that matches the key value in the table
buffer will be retrieved.
• table table_name – The name of the table that contains the record you want to read.
• by key_name | by number expr – Identifies the key by which you’ll search the table.
You can identify the key by its name or by its number. In the by keyname parameter,
keyname is the key’s technical name. In the by number expr parameter, expr is an
integer containing the number of the key, determined by its position in the table
definition. For instance, the third key created can be identified by the number 3, and
so on. If one of these parameters isn’t included, the first key will be used.
• refresh – This keyword applies only for SQL tables. When a get statement reads a
SQL table, a record is actually read from an in-memory buffer. The refresh keyword
refreshes the records in the buffer before the read operation occurs, ensuring that
the most-current data will be read.
Comments If the specified table isn’t open, the get statement will open it.
The err() function or the check error statement can be used after the get statement to
ascertain whether the operation was successful or to handle errors that occurred.
Example The following example attempts to retrieve the customer name based on the
customer number supplied in the parameter handler.
Additional information
Chapter 3, “Database-level Integrations”
56 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
H O U R ()
hour()
Description The hour() function returns the hours portion of a given time value.
Syntax hour(time)
Example The following example sets the variable hour_of_time to the number of hours in the
time value returned by the systime() function.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 57
I F T H E N . . . E N D I F
if then...end if
Description The if then...end if statement allows statements to be run on a conditional basis.
Syntax if boolexp then statements {elseif boolexp then statements}{else statements} end if
Parameters • boolexp – Any expression that can be evaluated as true or false, such as:
A=B
Customer_Name="John Smith"
A+B<C
• elseif boolexp then – If one or more elseif clauses are included, and if the if clause
has been evaluated as false, then the statements after the first elseif clause to be
evaluated as true will be run.
• else – If the else keyword is included, statements following it will be run if the if
clause and all elseif clauses have been evaluated as false. Only one else clause can
be included in an if then...end if statement.
Examples The following example displays a warning if the incorrect user is logged in to
Microsoft Dynamics GP.
The following example reads through every item in the IV_Item_MSTR table and
adjusts the list price based on the item type. The if then...end if statement selects
the appropriate list price adjustment.
58 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
M I N U T E ()
minute()
Description The minute() function returns the minutes portion of a given time value.
Syntax minute(time)
Example The following example sets the variable minute_of_time to the number of minutes
in the time returned by systime().
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 59
M K T I M E ()
mktime()
Description The mktime() function creates a time value from three integer values.
Example The following example sets a local variable named this_time to a time value of
2:25:37 PM.
60 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
M O N T H ()
month()
Description The month() function returns the month portion of a given date value.
Syntax month(date)
Example The following example sets a local variable named month_of_year to the number of
the month in the date value returned by the sysdate() function.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 61
R A N G E
range
Description The range statement is used to select a portion of a table to use. A range can reduce
the number of records that must be accessed in order to accomplish a task,
increasing the speed and efficiency of your application.
start by key_name , inclusive
Syntax range end table table_name
by number expr , exclusive
clear
Parameters • start | end | clear – Identifies the purpose of this particular range command. The
start keyword sets the beginning of the range to the current values in the table
buffer. The end keyword sets the end of the range to the current values in the table
buffer. The clear keyword clears any range set for the key, but doesn’t affect the
table buffer.
• table table_name – The name of the table the range will be applied to.
• by key_name | by number expr – Identifies the key this range will be associated
with. Keys can be identified by their name (by key_name) or by their numeric
position in the table definition (by number expr). This parameter isn’t used when
the clear keyword is used. If no key is specified, the first key is used.
• inclusive | exclusive – In the range end statement, this keyword specifies how the
range will be evaluated. This option applies only when the SQL database manager
is being used for the table; it will be ignored for the other database managers.
If the SQL database manager is being used, and the inclusive keyword is included,
an inclusive range will be generated. If the exclusive keyword is included, a pure
exclusive range will be generated. If a range type isn’t specified, Dexterity will
decide which type of range to use, based on how the key segments for the range
have been set.
Comments The selected range of the table will be treated as an entire table. For instance, a get
first statement that includes the same by key_name or by number expr clause that
the range statement used, will return the first record in the range.
You can define only one range at a time for a given table buffer, regardless of how many keys
have been defined for the table. Each key can’t have its own range. To use a new range to
access the table, you must clear the first range using the range clear statement.
Multisegment keys
If a key is composed of several segments, you can create ranges based on several
key segments. The clear field and fill statements are often used when setting ranges
for multisegment keys. Typically, the first several corresponding key segments of
the range start and range end are set to the same values. Then the remaining key
segments are cleared and filled.
62 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
R A N G E
For the c-tree database manager, ranges are always evaluated inclusively. Including
the inclusive or exclusive keyword has no effect on the range.
The following flowchart describes the process used to evaluate an inclusive range.
For the SQL database manager, how the range is evaluated depends on whether the
inclusive or exclusive keyword is included in the range end statement. If the
inclusive keyword is included, the range will be an inclusive range, just like the one
produced for c-tree. If the exclusive keyword is included, the range will be
evaluated exclusively.
The following flowchart describes the process used to evaluate an exclusive range.
Evaluating inclusive ranges for SQL is significantly slower than evaluating exclusive
ranges. For this reason, we recommend that you use inclusive ranges for SQL tables only
when absolutely necessary.
If the SQL database manager is used and neither the inclusive nor the exclusive
keyword is included in the range end statement, Dexterity will determine the type
of range used based on how the key segments for the range have been set. If the
range is “well-behaved” or Dexterity can alter the range to make it “well-behaved,”
an exclusive range will be generated. Otherwise, an inclusive range will be
generated.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 63
R A N G E
Starting from the leftmost key segment and working to the right, a “well-behaved”
range has the following characteristics:
1. The first 0 to n segments are set to equal values for both the range start and the
range end.
2. The next 0 or 1 segments are set to non-equal values for the range start and
range end.
3. The remaining segments (if any) are cleared for the range start and filled for the
range end.
If Dexterity analyzes a range and finds the range to be “well-behaved” except that
the rightmost key segments haven’t been cleared and filled, those segments will be
automatically cleared and filled and an exclusive range will be produced.
64 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
R A N G E
Examples The following example sets up a range so that only records with a customer name
between “A” and “K” will be accessed. The second key for the table is used because
it is composed of the Customer Name field. Note that the first line clears any
previous range that may have been used before the new range is applied.
The following example illustrates how to use a range for a multisegment key. The
Purchase_Data table is shown in the following illustration. It has a key composed of
the Purchase Date and the Store ID.
The following script sets a range to include all purchases made on 11/17/98 for all
stores. The first segment of the key is set to the date 11/17/98. The second segment
is set to its minimum value using the clear field statement. Then the start of the
range is set. The first segment remains 11/17/98. The second segment is set to its
maximum value using the fill statement. Then the end of the range is set. Using the
clear field and fill statements on the Store ID fields allows all stores to be selected.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 65
R A N G E
The following example illustrates how the inclusive keyword is included in the
range end statement to force an inclusive range for a table with a SQL database
type. The Purchase_Data table is shown in the following illustration. It has a key
composed of the Purchase Date and the Store ID.
The following script sets a range to include all purchases from 11/17/98 to 11/19/
98 where the Store ID is A.
Additional information
Ranges in Chapter 3, “Database-level Integrations”
66 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
R E L E A S E T A B L E
release table
Description The release table statement releases a lock on a record read with the change
statement.
Parameters • table_name – The name of the table buffer that will have its current record released.
Comments The table buffer won’t be cleared when a release table statement is run. Use the
clear table statement to clear the buffer.
Example The following example releases the current record in the RM_Customer_MSTR
table so another item can be read from or written to the table.
Additional information
Multiuser processing in Chapter 3, “Database-level Integrations”
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 67
R E M O V E
remove
Description The remove statement removes the current record or a range of records from the
specified table.
Parameters • range – Causes the entire set of records that fall within the currently active range to
be removed. If this keyword isn’t used, only the record in the table buffer will be
removed from the table.
• table table_name – The name of the table from which a record or range of records
will be removed.
Comments To remove a single record, the record must have been read using the change
statement, because the record must be locked to be removed.
The record must be actively locked to guarantee that no other user in a multi-user
system will be accessing the record when it’s removed.
If the remove range statement is used for a table for which a range hasn’t been set,
all of the records in the table will be removed.
Examples The following example removes the current record from the RM_Customer_MSTR
table.
The following example removes records for all the customers from A to K for the
RM_Customer_MSTR table. The range of customers to remove is set first, then the
records are removed.
68 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
R E P E A T . .. U N T I L
repeat...until
Description The repeat...until statement is used to run statements repetitively. The statements
enclosed in the repeat statement are run, then the exit condition is tested. If the
condition returns a false value, the loop is continued. If true is returned, the loop is
exited.
• boolexp – Any expression that can be evaluated as true or false, such as:
A=B
Customer_Name="John Smith"
A+B<C.
Example The following example reads all the records in the RM_Customer_MSTR table.
Records are read until an End of File (EOF) error is returned.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 69
S A V E T A B L E
save table
Description The save table statement saves the current contents of the table buffer to the table.
Parameters • table_name – The name of the table that will have its table buffer contents saved.
Example The following example retrieves each record from the RM_Customer_MSTR table
and sets the Salesperson ID field to STEVE K. Then the record is saved.
70 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
S E C O N D ()
second()
Description The second() function returns the seconds portion of a given time value.
Syntax second(time)
Example The following example sets the variable second_of_time to the number of seconds
in the time value returned by the systime() function.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 71
S E T
set
Description The set statement assigns the value of an expression to a field or variable.
Comments The field can have any data type, but the expression should have the same storage
type as the field. If you use the set statement to set the value of a field in a table that
isn’t open, the set statement will open the table.
The following example shows the set command used to perform a calculation.
72 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
S E T D A T E ()
setdate()
Description The setdate() function is used to create a date value or modify an existing date
value.
• month – A new month value for the date, in the range 0 to 12. If set to 0, the current
month value of the specified date field won’t be modified. If an attempt is made to
enter an out-of-range month, an alert message is automatically displayed to the
user.
• day – A new day value for the date, in the range 0 to 31. If set to 0, the day value of
date won’t be modified. If an attempt is made to enter an out-of-range day for any
month, an alert message is automatically displayed to the user.
• year – A new 4-digit year value for the date. If set to 0, the year portion of date won’t
be modified.
Example The following example sets the value of the start_date variable. The day is set to the
12th day of October, and the year is set to 1998.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 73
S T R ( )
str()
Description The str() function returns a string representation of a numeric value. This is useful
for any situation in which you want to include a number in a string to be displayed
to the user.
Syntax str(expression)
Parameters • expression – The numeric variable, field, or value you wish to convert to a string.
Comments The str() function is commonly used to convert non-string values to string values so
the parameter handler can be used to return them to the Continuum application.
Example The following example converts the value of the List Price currency field to a string
so it can be included in a message to the user.
Additional information
Chapter 2, “Working With Data”
74 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
S Y S D A T E ()
sysdate()
Description The sysdate() function returns the current date from the current computer.
Syntax sysdate()
Parameters • None
Example The following example sets the value of the start_date variable to the system date.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 75
S Y S T I M E ( )
systime()
Description The systime() function returns the current system time from the current computer.
Syntax systime()
Parameters • None
Example The following example sets the value of the start_time variable to the system time.
76 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
V A L U E ()
value()
Description The value() function returns a numeric value containing the first set of numbers
encountered in a specified string.
Syntax value(string)
Parameters • string – The string expression or string field you wish to evaluate.
Return value Initially, the value is returned as a currency type. It is converted to the appropriate
numeric type based on the storage type of the field or variable the value is set to.
Comments If the string value contains letters and numbers, only the first numbers in the string
will be converted. The conversion process will begin with the first number
encountered, and end when the first character that is not a number is encountered.
For example, the string “Jones78Smith8” will be converted to 78.
If the string value contains a number with the system-defined decimal separator, the
return value may be rounded, depending on the type of field the return value is set
to. If the data type is set to an integer or long integer, the return value will be
rounded up or down as appropriate. If the value is returned to a currency field or
variable, the value won’t be rounded.
The value() function is commonly used to convert string values to their numeric
equivalents after the Continuum application has used the parameter handler to
pass them to pass-through sanScript.
Examples The following example converts the string “A123” to the value 123 and assigns the
value to the integer variable new_integer.
local integer new_value;
The following example converts the string “Cost123.45” to the value 123 and
assigns the value to the integer variable new_integer. The value is rounded because
it is returned to an integer variable.
local integer new_value;
The following example converts the string “Cost123.45” to the currency value
123.45000 and assigns the value to the variable new_currency. The value isn’t
rounded because it is returned to a currency field.
local currency new_currency;
Additional information
Chapter 2, “Working With Data”
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 77
W A R N I N G
warning
Description The warning statement creates a warning dialog box displaying the specified string.
The dialog box will have one button labeled OK.
Parameters • expression – A string field, text field, or string or text value with the message to be
displayed in the dialog box.
Example The following example generates a warning message for the user.
78 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
W H I L E D O .. . E N D W H I L E
Parameters • boolexp – Any expression that can be evaluated as true or false, such as:
A=B
Customer_Name="John Smith"
A+B<C
Example In the following example, items are read from the RM_Customer_MSTR table until
the end of the table is reached.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 79
Y E A R ( )
year()
Description The year() function returns the year portion of a given date value. The returned
value will be a four-digit year, such as 1998.
Syntax year(date)
Example The following example sets a local variable named year to the number of the year in
the date value returned by the sysdate() function.
80 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
Chapter 6: Data types
The following is a list of the data types used for fields that are stored in tables, and
provides an example illustration and information of how to work with fields of each
type.
Boolean
Example None
Description Stores a boolean (true or false value). The default value is false.
Check box
Example
Description Stores and displays a boolean (true or false) value. The value in the field is true if
marked and false if unmarked.
Combo box
Example
Description Allows a text item to be entered by a user or chosen from the list. The value in the
field is stored as a string.
Composite
Example
Description A composite is a special data type that is composed of several individual fields. The
Microsoft Dynamics GP Account Number field is a composite.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 81
PA RT 2 S A N S C R I P T R E F E R E N C E
Currency
Example
Description Displays a value as a currency amount, with a currency symbol and thousands
separator if specified in the data type’s format.
Date
Example
Description Stores and displays a date. To set the value of a data field or variable, use the
setdate() function. To read the day, month and year portions of a data value, use the
day(), month() and year() functions. No formatting information is stored with the
date value.
An uninitialized date field (one that hasn’t been set to a value) will have the value
000000.
Drop-down list
Example
Description The value of the drop-down list is an integer associated with the item selected in the
list. Because the list items can be sorted, the value associated with an item may not
correspond to its position. For example, the first item appearing in the drop-down
list could have the value 3 associated with it. This means that when the item is
selected, the drop-down list will have the value 3, not 1 as you might expect.
Integer
Example
82 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A P T E R 6 DA TA T Y P E S
List box
Example
Description The value of the list box is an integer associated with the item selected in the list.
Because the list items can be sorted, the value associated with an item may not
correspond to its position. For example, the first item appearing in the list could
have the value 3 associated with it. This means that when the item is selected, the
drop-down list will have the value 3, not 1 as you may expect.
Long integer
Example
Radio group
Example
Description Groups radio buttons and stores a single integer value corresponding to the
position of the selected radio button in the tab sequence. If the first radio button is
selected, the value 0 is stored; if the second one is selected, the value 1 is stored, and
so on.
String
Example
Text
Example
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 83
PA RT 2 S A N S C R I P T R E F E R E N C E
Time
Example
Description Stores and displays a time value in 24-hour format. To set the value of a time field or
variable, use the mktime() function. To read the hour, minute and second portions
of a time value, use the hour(), minute() and second() functions. No formatting
information is stored with the time value.
An uninitialized time field (one that hasn’t been set to a value) will have the value
000000.
Visual switch
Example
Description Displays a series of items. The value of the field is an integer corresponding to the
position of the currently-displayed item in the series, starting with 1 and
incremented by 1.
84 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
Chapter 7: Alert Messages
This chapter describes the alert messages that can occur when you use pass-through
sanScript. It lists compiler messages and runtime messages.
Compiler messages
Compiler messages can occur when you send pass-through sanScript to the
Microsoft Dynamics GP runtime engine to be compiled and executed. When a
compiler error occurs, the message will be returned in the CompileErrorMessage
parameter of the ExecuteSanScript method.
Some messages identify the resource, such as a field or form, that caused the error.
Italic type is used to indicate items that will be substituted when the message is
returned.
• Be sure the resource name is properly qualified. For example, if the resource is a
global variable, be sure that you’re using the qualifier “of globals” in the script.
Comment unterminated.
Situation You started a comment using an opening brace - { -, but didn’t indicate the end of
the comment with a closing brace - } -. There must be one closing brace for each
opening brace.
Solution Be sure you’ve included both braces when adding comments to a script.
Expression not allowed in function_name.
Situation You’ve used a function that doesn’t allow an expression as a parameter.
Function_name is the name of the function that contains the invalid expression.
Solution Be sure that the function you’re using allows an expression as a parameter before
you attempt to compile the script.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 85
PA RT 2 S A N S C R I P T R E F E R E N C E
• If the item shouldn’t be a local variable, it’s probably not properly qualified.
86 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A P T E R 7 A LE R T M E S S AG E S
• Review the statements in the script and be sure there’s a semicolon at the end of
each.
• Be sure the field is part of the table. You can verify this by using the Table
Descriptions window from the Resource Descriptions tool.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 87
PA RT 2 S A N S C R I P T R E F E R E N C E
Solution If you’re using an expression in the script, review the operands to be sure they use
the same data type. If using a variable, be sure the data type for the variable
matches the values set for that variable in script. If necessary, use the str() and the
value() functions to convert data from one data type to another.
If the message was “active lock on non-active lock table,” remove the lock option.
88 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A P T E R 7 A LE R T M E S S AG E S
Runtime messages
Runtime messages can appear when your sanScript code is executed by the runtime
engine. When a problem occurs, the message will be displayed in a dialog box in the
application. Italic type is used to indicate items that will be substituted when the
message is displayed.
Some messages will appear only if the check error statement is used in a script after
a table operation.
A get/change next operation on table table_name has reached the end of the table.
Situation You attempted to read the next record in the table with the get next or change next
statements, but the end of the table was reached. This message can appear when the
check error statement is used. Table_name is the table that encountered the error.
Solution Use the err() function to check for the end of table (EOF) condition.
A get/change operation on table table_name caused a file sharing error.
Situation You attempted to read and actively lock a record that was actively locked by
another user. This message can appear when the check error statement is used.
Table_name is the table that encountered the error.
Solution Be sure no other users have placed an active lock on a record before you attempt to
read and actively lock the same record. If multiple users must access the same
record at the same time, use passive locking.
A get/change operation on table table_name could not find a record.
Situation You attempted to retrieve a record from a table, but the record couldn’t be located.
This message can appear when the check error statement is used. Table_name is the
table that encountered the error.
Solution Check the key values to be sure they’re correct. Also be sure data has been saved in
the table before you retrieve records.
A get/change operation on table table_name failed. A record was already locked.
Situation You attempted to retrieve a record from a table, but there was already a locked
record in the table buffer. Table_name is the table that encountered the error.
Solution To read another record from a table into the record buffer, the lock on the current
record in the table must be released. Use the release table statement to release the
lock from the current record before reading another record.
A get/change operation on table table_name is for an invalid key.
Situation You attempted to read a record from a table using a key that doesn’t exist.
Table_name is the table that encountered the error.
Solution Be sure that at least one table key has been defined for the table. Check whether
you’re using a key that doesn’t exist.
A remove operation on table table_name caused a file sharing error.
Situation You attempted to remove a record from a table that was actively locked by another
user. Table_name is the table that encountered the error.
Solution Be sure no other users or forms have placed an active lock on a record before you
attempt to delete the same record. If multiple users must access the same record at
the same time, use passive locking.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 89
PA RT 2 S A N S C R I P T R E F E R E N C E
A remove operation on table table_name failed because the record couldn't be locked.
Situation You attempted to remove a record from a table, but the record was not locked.
Table_name is the table that encountered the error.
Solution Be sure you’ve used the change statement to read the record and lock it before you
use the remove statement to remove the record from the table.
A save operation on table table_name caused a file sharing error.
Situation The following situations can cause this message:
• You attempted to save a record that was actively locked by another form or
another user. Table_name is the table that encountered the error.
Solution Be sure no other users or forms have placed an active lock on a record before you
attempt to save the same record. If multiple forms or users must access the same
record at the same time, use passive locking.
A save operation on table table_name has created a duplicate key.
Situation You attempted to save a record that has the same key value as another record
already in the table. This message can appear when the check error statement is
used. Table_name is the table that encountered the error.
Solution Use a different command. This message will appear if you want to change the
contents of records in a table, but are using the get statement instead of the change
statement. If you want to change records in the table, be sure to use the change
statement.
A save operation on table table_name record was changed by another user.
Situation You attempted to save a record, but another user had accessed the record and
changed it. This message can appear when the check error statement is used.
Table_name is the table that encountered the error.
Solution Read the record again to view the changes made by the other user. Then make
appropriate changes to the information stored in the record and save it again.
An open operation on table table_name caused a file sharing error.
Situation You tried to open a table that was already opened for exclusive use. Table_name is
the table that encountered the error.
Solution Wait until the other user is no longer accessing the table for exclusive use. Then
attempt to open the table.
An open operation on table table_name failed accessing SQL data.
Situation You’ve attempted to retrieve data from a table.
Solution This alert message typically will include a More Info button. Click the More Info
button to read the ODBC driver message, which will help you determine the source
of the problem. The following list includes possible solutions:
• The database is full. Using your database’s Administrator function, increase the
size allocated for the database.
• The system log is full. Using your database’s Administrator function, increase
the size of the system log, back it up to tape, or dump (delete) it.
90 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
C H A P T E R 7 A LE R T M E S S AG E S
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 91
92 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
Glossary Check box
A data type that allow users to mark or
Drop-down list
A data type that allows users to select one
unmark a selection. Check boxes are stored item from a list. The value of a drop-down
Active locking as boolean values. list is the integer associated with the selected
A method of locking that ensures only one item.
user can change or delete the contents of a Combo box
record at one time. The data in the locked A data type that allow users to enter a text Element
record can’t be changed or deleted by value or choose that value from a list. The One of the fields in an array field.
another user until the lock is released. The combo box value is stored as a string.
Error dialog box
lock for the record is released when the user Command The modal dialog box generated with the
with the active lock moves to another record
A function or statement included in the error statement. A text string, the standard
or closes the table. sanScript language. error icon for the operating system, and an
Alert message OK button are displayed in the dialog box.
Compile
A message that appears when inappropriate, To run a script through a compiler. A Error trapping
inadequate or unclear data or instructions
compiler translates the script instructions To watch for and handle an exceptional
are issued, when data is not accessible or
into a language that the computer can event, such as an error. In sanScript, the err()
when a confirmation is required. understand. Once the script has been function is used to trap table errors that
Array compiled, the instructions within the script occur at runtime, allowing the script to
A field or variable containing multiple can be executed. respond appropriately.
occurrences of the same type of information. Compiler errors Expression
The individual pieces of information stored
Errors generated when a script is compiled. A sequence of operands and operators that
by an array are called elements. For example, are evaluated to return a value.
a seven-element array could be used to store Component
daily sales totals instead of seven individual One field of a composite field. Field
fields or variables. A field contains a single piece of information
Composite used by the application dictionary. A field
Array index A composite is a special data type that is can be displayed in a window or stored in a
The number designating a specific element composed of several individual fields. The table. The kind of information the field
within an array. Microsoft Dynamics GP Account Number displays or stores depends on the data type
field is a composite. associated with it.
Ask dialog box
A modal dialog box generated by the ask() Constant Form
function. A dialog box displays a text string, A fixed numeric or string value used in In Dexterity-based applications, a form is a
an information icon and up to three push scripts. Several constants have been defined collection of related windows, menus and
buttons allowing the user to make a for Microsoft Dynamics GP. SanScript also scripts.
selection. has predefined constants that are used with
specific functions or statements. Form function
Background processing A user-defined function that’s associated
Processing, such as printing a report or Data type with a specific form.
running a procedure, that occurs while A resource in a Dexterity-based application
allowing other tasks to be completed that defines the characteristics for a field. Form procedure
simultaneously, such as entering data in a A procedure that’s associated with a specific
window. Date and time expression form.
An expression that results in either a date or
Boolean expression time value. Date and time expressions can Function
An expression that results in a value of true also result in a numeric value. A sanScript command that uses parameters
or false. and returns a value that must be used in an
Deadlocked condition expression.
Buffer The error condition that occurs when two
A temporary storage area in a computer’s users or scripts lock separate records and Global variable
memory. then also try to lock the records already A variable available to any script in the
locked by the other. For example, suppose application at any time. Global variables are
c-tree Plus script A locks record X and script B locks active the entire time a Dexterity-based
A data manager used within the Microsoft
record Y. Script A then also attempts to lock application is open.
Dynamics GP application.
record Y and script B also tries to lock record
X. Both requests will be denied, forcing both In parameter
Called script A value that is passed from the calling script
The procedure or form procedure that’s scripts to wait endlessly for the desired
record. Dexterity-based applications contain to the called script. The called script cannot
invoked by a calling script. The parameters change the value of an in parameter.
for the called script are provided, or passed, mechanisms to avoid deadlock conditions.
by the calling script. Dictionary Inout parameter
A group of resources that, when interpreted A value passed from the calling script to the
Calling script called script, then back to the calling script.
The script that accesses, or calls, a procedure. by the runtime engine, present a complete
functioning application. Key
A field or combination of fields within a
record that is used as a basis by which to
store, retrieve and sort records.
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 93
GLOS SA RY
94 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
Index composites
data type 81
dates
converting to strings 15
defined 93 creating 73
A described 13 data type 7, 82
abort script statement 39 for procedure parameters 32 modifying 73
account numbers, for procedure constants parameters for pass-through
parameters 32 defined 93 sanScript 15
active locking described 8 returning
defined 93 in sanScript 8 current system date 75
described 20 predefined 8 month portion 61
addition operator 11 types 8 portion 49
alert messages user-defined 8 year portion 80
chapter 85-91 conventions in documentation, see subtracting numeric values from 11,
compiler errors 85 documentation example 10
defined 93 converting day() function 49
runtime messages 89 data types 15 deadlocked condition, defined 93
arrays numeric values to strings 74 deleting records, see removing records
defined 93 strings to numeric values 77 Dexterity development system,
described 12 countrecords() function 48 pass-through sanScript 5
ask() function 40 c-tree Plus, defined 93 dialog boxes
ASKBUTTON, predefined constants 8 currency using ask() function 40
converting to strings 74 using error statement 52
B data type 7, 82 using warning statement 78
background processing dictionary, defined 93
described 33 D division operator 11
monitoring 33 data type conversions documentation, symbols and conventions
temporary tables 33 explicit conversions 15 2
boolean, data type 7, 81 implicit conversions 15 drop-down lists
boolean expressions data types data type 82
defined 93 boolean 81 defined 93
described 9 chapter 81-84 duplicate records
buffers check box 81 described 28
defined 93 combo box 81 retrieving 28
described 17 composite 81 saving 28
converting 15
C currency 82 E
call statement 41 date 82 elements of arrays
called script, defined 93 defined 93 defined 93
calling script, defined 93 described 7 described 12
case...end case statement 42 drop-down list 82 equality operator 11
change statement 43 for parameters 15, 31, 32 err() function
check boxes integer 82 return values 50
data type 81 list box 83 syntax and description 50
defined 93 long integer 83 error dialog boxes, defined 93
check error statement 45 radio group 83 error statement 52
clear field statement 46 string 83 error trapping
clear table statement 47 text 83 defined 93
clearing time 84 for table errors 45
fields 46 visual switch 84 using the err() function 50
table buffers 47 database-level integrations errors
combo boxes adding records 28 checking for 45, 50
data type 81 chapter 17-29 compiler errors 85
defined 93 checking for errors 45, 50 error codes 50
commands common operations 17 error statement 52
defined 93 key values 28 runtime errors 89
syntax conventions 38 retrieving records 28 warning statement 78
compiler errors, defined 93 table buffers 17 exclusive ranges
compiler messages, described 85 date and time expressions described 26
compiling, defined 93 defined 93 example 26
components, defined 93 described 9 how to evaluate 63
explicit type conversions 15
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 95
IN DEX
96 C O N T I N U U M S A N S C R I PT S U PP L EM EN T
I N D E X
C O N T I N U U M S A N S C R I P T S U P P L E M E N T 97
IN DEX
updating records
described 19
example 19
user-defined constants
described 8
example 8
user-defined functions
defined 94
described 34
V
value() function 77
variables
defined 94
global variables 8
in sanScript 7
local variables 7
setting values 72
types 7
visual switch data type 84
W
warning dialog boxes, defined 94
warning statement 78
warning symbol 2
well-behaved ranges 27, 63, 64
while do...end while statement 79
working with data, chapter 15-16
Y
year function 80
98 C O N T I N U U M S A N S C R I PT S U PP L EM EN T