| Introduction |
|
| This section covers the structural concepts used throughout this manual. Some of the terminology discussed will be familiar to programmers with experience in other Business Basics; however, ProvideX has several unique properties. Before you attempt to program in ProvideX, take some time to understand the different aspects of the language. For a comprehensive look at the ProvideX environment, it's uses, and the details required to develop applications, refer to the ProvideX User's Guide. |
||||||||||||||||||||||||||||||
| ProvideX Session | The
ProvideX environment comprises a Command mode
and an Execution mode. When in Command mode,
ProvideX will be waiting for a directive or statement
to be entered. Execution mode begins once a RUN
or a CALL directive is used to execute a
program. By default, ProvideX initializes in Command mode; as indicated by the Command mode prompt '->'. Directives can be entered in Command mode. If a directive does not include a leading line number, it is executed immediately; otherwise, the statement is used in the construction of a program. When a statement is inserted into a program, the prompt changes from '->' to '-:' to indicate that the program has been changed but not saved. When ProvideX is in Execution mode, it receives and executes all the statements that constitute a program. The program remains in Execution mode until completed (via the STOP or END directive), an error occurs, or it is interrupted via a BREAK or ESCAPE instruction. The ProvideX session can be terminated using BYE, QUIT, or RELEASE. These concepts are discussed in further detail in the ProvideX User's Guide. |
|||||||||||||||||||||||||||||
| Directives and Statements | In
ProvideX, all processing is controlled by the use of directives
commands that tell the system what task is to
be performed. Each program statement (line of code)
consists of one or more directives. When ProvideX
executes a program, it executes all directives contained
in a statement from left to right, then proceeds to the
next line. Some directives provide the ability to alter
the normal flow of execution. The general format of a program statement includes a unique line number (optional), the directive indicating the operation to perform, parameters, and comments. Parameters are syntax elements, keywords, operators, and arguments that can be used to further define a directive's operation. For example, the complete syntax for the CLOSE directive appears as follows: CLOSE (chan[,ERR=stmtref])[,(chan[,ERR=stmtref])...]. Depending on the statement, it is possible to exclude all but the mandatory parameters from the directive, as in CLOSE (14). See Directives, , for the complete list of directives and the details of their mandatory or optional parameters. |
|||||||||||||||||||||||||||||
| System Functions | A ProvideX system function consists of a three-character function name followed by an open parenthesis, the parameter(s) for the function, an optional error transfer, and finally a close parenthesis, e.g., AND(A$,B$,ERR=0300). The number and type of parameters vary from function to function. All may include the ERR= option (even those where an error is unlikely). System functions are listed and described in System Functions. | |||||||||||||||||||||||||||||
| Data and Variables | ProvideX supports two basic types of data -- Numeric data and String data. Numeric data consists of numeric values such as account balances, prices and quantities. String data consists of textual information such as account names and descriptions. A ProvideX program maintains and processes its data using variables: numeric variables to store numeric values and string variables to store textual information. The language includes various internally-defined variables for providing system information, such as the date and time. These are listed and described in System Variables. You can use system variables wherever normal program variables would be used, but you cannot modify them. | |||||||||||||||||||||||||||||
| *Note* | All system variables have reserved three-character names and do not have a trailing dollar sign $, e.g., CTL. To avoid potential conflicts with the reserved list (since ProvideX might reserve more three-character variables in the future), Sage Software Canada Ltd. recommends strongly that you do not use three-character variable names. | |||||||||||||||||||||||||||||
| Mnemonics | Mnemonics
are used to control output to terminals and printers. A
mnemonic instruction is enclosed in single quotation
marks. Refer to Mnemonics for an
alphabetical listing of all ProvideX mnemonics, complete
with formats and descriptions. Refer to the MNEMONIC Directive for more information. Examples:
|
|||||||||||||||||||||||||||||
| System Parameters | System parameters are normally used at start-up to define the system's operation under ProvideX. For example, the 'BY' parameter is used to define the base year for the JUL( ) and DTE( ) functions. Like mnemonics, system parameters are enclosed in single quotation marks. Refer to Chapter 6. System Parameters, , for an alphabetical listing of system parameters, complete with formats and descriptions. For further information, refer to the PRM( ) Function, and the PRM System Variable. | |||||||||||||||||||||||||||||
| Graphical Control Objects | A graphical control object in ProvideX programs are used to display information, input data, and handle event processing. The following directives are used to create and maintain the various control object types: BUTTON, CHART, CHECK_BOX, DROP_BOX, GRID, LIST_BOX, MULTI_LINE, RADIO_BUTTON, TRISTATE_BOX, VARDROP_BOX, VARLIST_BOX, V_SCROLLBAR, and H_SCROLLBAR. | |||||||||||||||||||||||||||||
| *Note* | In Windows, the above directives use Graphical Device Interface (GDI) resources/handles that are only released when the window they are in is dropped or cleared. | |||||||||||||||||||||||||||||
| Graphical control objects can also be produced using the NOMADS toolset for GUI-based application development. Refer to the ProvideX NOMADS Reference. The attributes of a control object can be referenced and determined by the use of property names (Height, Font$, Text$, TextColour$, ...). The object itself is defined by a numeric variable containing the CTL value associated with the control, followed by an apostrophe and the property. Refer to Control Object Properties for a description of the Apostrophe Operator, and to review all properties listed in the Properties List. | ||||||||||||||||||||||||||||||
| Specialty Files | ProvideX
supports the use of a series of specialty files.
See Special File Handling, for
descriptions of the commands you can use with the
following special device files:
|
|||||||||||||||||||||||||||||
| Special Command Tags | ProvideX
supports the use of a series of special file tags.
See Special Command Tags, for information
on the following:
|
|||||||||||||||||||||||||||||
| Object Oriented Programming | The
ProvideX language has been extended to support all of the
key design principles of Object Oriented Programming (OOP).
Various OOP-related articles and examples are available
from the ProvideX website, www.pvx.com. The three basic principles of OOP are Encapsulation, Inheritance, and Polymorphism. These concepts provide a major part of the framework used to create and interact with objects. ProvideX OOP objects are defined through the use of classes. A class defines the name given to the object definition, as well as the objects properties and methods. Properties are the data portion of the object, consisting of fields or variables. Methods (or functions) are the actions that the object will perform. The defined properties/methods are accessible via the Apostrophe Operator. The following directives and functions are used to handle OOP mechanisms in ProvideX :
|
|||||||||||||||||||||||||||||
| Accessing Data Files | ProvideX
supports a wide variety of file formats:
proprietary/non-proprietary, program, link, device, data,
etc. When referring specifically to data files
in ProvideX, the primary file types and record formats
are defined as follows:
|
|||||||||||||||||||||||||||||
Access
to a data file is controlled by the use of a channel
or logical file number. The link between data
file and channel is established using the OPEN
directive. All subsequent input and output to the file
uses the same channel, which cannot be reused until the
file is closed (via CLOSE, START,
BEGIN, or by termination of the user
session). The directives listed below are used to create,
delete, and rename data files:
The following directives are used for file input/output and access:
There are also several system functions for file processing:
Refer to the ProvideX User's Guide for further information on handling data files. |
||||||||||||||||||||||||||||||
| Other Facets of ProvideX | The
appendix at the end of this manual expands on several
additional features of the ProvideX programming language. Subject
sections are listed as follows:
|
|||||||||||||||||||||||||||||
| Error Reporting and Handling | If
an error condition is detected during the execution of a
program, the associated error code(s) can be obtained
using the ERR and RET system
variables. The line number of the last system-detected
error can be determined by the ERS
variable. The MSG( ) function provides a
description for any known ProvideX error in the range of
0 to 255. The system
parameter 'ES', if enabled, can be used
to display any OS error messages, along with the normal
ProvideX error, from a Command prompt. By default, when an error occurs in an application, ProvideX will stop processing, display the error code/message and statement where it occurred, and then return to Command mode. Most ProvideX directives and functions, for which errors are anticipated, provide an error transfer option denoted by an ERR=stmtref option in the syntax description (stmtref represents a number or statement label to which to transfer control). Error handling can also be specified via the SETERR directive. The ERROR_HANDLER directive is used to assign a generic application-wide error handling program that will intercept any un-trapped errors in an application. For further information on error codes and error handling in ProvideX, refer to the ProvideX User's Guide, as well as the following sections in this manual:
|
|||||||||||||||||||||||||||||