Professional Documents
Culture Documents
Agenda
1. Introduction to Functions
2. Built in functions
3. Message functions
4. Introduction to Action Diagram
5 User points
6. Parameter Usage/Roles
7. Defining Parameter
8. Arrays
9. Handson - Arrays/ Parameters/ Simple program
Introduction to Functions
Building blocks' or 'templates' that are linked
together to form programs.
Programs may comprise of subroutines/ messages/
as low-level arithmetic operations or as
combinations of these elements
Function is a process that operates on files & fields
Functions are implemented in two ways
External - the function is implemented as a
separate HLL program
Internal - the function is implemented as source
code inside the calling function
Functions types
Standard Functions
Built-In Functions
Functions Fields
Message Functions
Standard Functions
The standard functions consist of a variety of
function types, each of which performs a specific
process
Divided into 3 categories
Database Functions
Device Functions
User Functions
Database Function
Basic routines for accessing the database
All are internal functions
There are 4 database functions
1) CRTOBJ - Create Object
2) CHGOBJ - Change Object
3) DLTOBJ - Delete Object
4) RTVOBJ - Retrieve Object
Device Functions
Used in interactive & report programs
Consist of panel/report design & action diagram
All device functions are external functions except for
PRTOBJ function
Implemented as programs that operate over databases
Device Design specifies the layouts of fields and
constants on the panels or report designs for a function
User Functions
Means of incorporating user programs or
subroutines into Advantage:2E generated
applications
Processing steps can be specified with action
diagrams or user-written HLL
Implemented as inline code (internal functions) or
call to programs (external functions)
The User Functions are
1) EXCINTFUN - Execute Internal Function
2) EXCEXTFUN - Execute External Function
3) EXCUSRPGM - Execute User Program
4) EXCUSRSRC - Execute User Source
Built-in Functions
Execute functions like arithmetic operations,
string manipulation, control operations like
commitment control & program exit.
Specified within action diagrams
Implemented as in-line source code within calling
functions
The Built-in functions are
1) Add
2) Commit
3) Compute
4) CONCAT -Concatenation
5) CVTVAR - Convert Variable
6) DIV - Divide
7) DIV WITH
REMAINDER
8) Exit Program
9) Modulo
10) Move
11) Move All
12) MULT - Multiply
13) Quit
14) RTVCND - Retrieve Condition
15) Rollback
16) Set Cursor
Message Functions
Parameter Usage/Roles
Parameters define the values to be communicated
between functions at execution time
How a parameter is used in the called function will
depend on the type of the called function, the
processing specified for that function, or both
Usage Type
Input only, Output only, Both, Neither
Flag Error Status
specifies error in the called function
Every function takes the fields in the attached
access path as its default parameters of functions
Parameter Roles
Specifies the use of parameter in function
Following are the parameter roles
Map Parameter - the parameter is added
automatically to the corresponding field on the
receiving functions panel design. Map Neither
parameter adds field to panel design without
passing a value
Restrictor Parameter - the parameter restricts
the updation of field by making it input only field
Positioner Parameter - the parameter is used to
position a function to start reading records from a
particular record
Vary Parameter - the parameter can have a
varying length. Useful for interfacing with userwritten functions
Parameter Context
Parameter context specifies how a field is used in a
function
1. The "DB1" (DATABASE FILE 1) Context
. The DB1 context contains the fields which are in the
first, or only, format of the AllFusion 2E access path
to which An AllFusion 2E function attaches.
. Any field on the access path format will be available
in the DB1 context.
. The DB1 context is available in the action diagram
of all function types which update the database,
both after reading a database file and before writing
to the database.
Arrays
The array provides a way of storing data, in memory,
within a function, which will persist across calls to that
function providing the function does not close down
Arrays may be used to define parameters for a function,
thus avoiding the limit of 9 lines per function
To read an array, simply call the RTVOBJ based over the
array from the calling function.
To delete all array elements, call a DLTOBJ based on the
array, with no parameters specified.
To load an array, build a RTVOBJ reading all required
records over the appropriate file, and when each record
is found call the CRTOBJ for the array.
Part 2 Hands on
Create a program to
Accept Emp Code & Emp Marks as input
Based on Marks calculate Grade and
Result
Update the file
Thank You