Programming Basics
Programming Basics
Programming Basics
coding steps
Global Variables
Global variables are defined in I_COMMON. This insert is included in every T24
program and
therefore this common block is available to all programs. The prefix of C$ has
been adopted for global
variables, however there are many variables in I_COMMON that were defined
before this standard
was adopted and consequently do not use this prefix.
Standard Variables
Files and records
Example
File Variable F.filename F.ACCOUNT
File name FN.filename FN.ACCOUNT
Record variable R.filename R.ACCOUNT
Standard Subroutines
Operation Routines
Read, writes etc. F.READ, F.WRITE ...
File opens OPF
Application
An application records the data entered and stores it in an associated file, field by
field
--------------------------------------
steps
1] include insert files
2]open the files using OPF
3]read the application using call.f.read
--------------------------------------
$INSERT I_COMMON
$INSERT I_EQUATE -these are included for all common variables
$INSERT I_F.CUSTOMER -open customer file and read all records
-----------------------------------CREATING AN APPLICATION-------------------------------------
[STEPS deciding on application name,
Product information,
Type,Classification,
What functions are permitted,
Deciding fields,
Business logic]
STEP 1 NAMING
The name of the application must be meaningful, should give some indication as
to its purpose and should be prefixed by the product code of the application,
where the product code should exist on EB.PRODUCT
Classifications
There are three primary classifications of application:
Having defined the high level properties of the application, the next
step is to define the fields that make up the application. Every application MUST
have a corresponding field definitions subroutine. The name of this subroutine is
the full name of the application with the suffix “.FIELDS”, e.g.
CR.CAMPAIGN.OPPORTUNITY.FIELDS. Your new .FIELDS subroutine should be
based on the TEMPLATE.FIELDS template that is shipped as part of the release.
Once defined, save and compile your .FIELDS subroutine.
Standard APIs Table has the following methods to define the fields:
Table.addField Add a field with standard data types
Table.addFieldDefinition Add a field using F, N and T style
Table.addFieldWithEbLookup Add a field with a virtual table
Table.defineId Define the ID field
Field.setCheckFile Add a check file to a field
Table.setAuditPosistion Defines the last field position
EB.DEV.HELPER is a standard utility that creates all of the artefacts that are required to run an
application in T24. The key to the record is application that you are working on, and once verified will
perform a number of actions if relevant field is flagged
PGM.FILE Creates a PGM.FILE record based on the information set in the properties array
FILE.CONTROL Creates a FILE.CONTROL record based on the information set in the properties
array INSERT Creates the insert file (I_F.MY.APPLICATION) that holds the equated field
names. Uses the prefix defined in the EQUATE.PREFIX property
CREATE.FILE Creates the physical database files using EBS.CREATE.FILES
UPDATE.SS Updates / Creates the STANDARD.SELECTION record via OFS and sets the
REBUILD.SYS.FIELDS flag to ‘Y’