Sequence Number Definition
This function is used to create the sequence number counters and to store their value in the supervisor table APLCOM. Each sequence number counter can be indexed. Each sequence number counter is available in a variable class [C] of the same name. These are the class [C] variables that must be used in the processed for the allocation of sequential numbers (for example the import process number). The characteristics of these class [C] variables are as follows :
- variable with the same name as the sequence number counter
- variable can be indexed
- variable available at the time of opening a session ; there is no place to declare it in the processes.
- variable common to all sessions.
- variable loaded and automatically loading the APLCOM table by the engine.
Prerequisite
Refer to documentation Implementation
Screen management
Entry screen
Block number 1
Sequence number (field COMNOM) |
This code identifies the current record in a unique way. |
Type (field TYP) |
Nature of the parameter :
|
Length (field COMLEN) |
The length can be entered in an alphanumeric sequence counter. |
Grid List of values
No. (field NUMLIG) |
Ind (field COMIND) |
Define the current index in the grid. |
Value (field COMFLD) |
Indicate the value of the parameter for each index. By convention, this is the value last allocated. |
Sequence number counter list
Code |
Use |
EXPORT |
Export number |
INTERLOC |
Automatic coding of employees |
NUMFIL |
Bank file number |
NUMIMP |
Import/Export process number |
NUMTEX |
Text number |
Development method
All variables in class [C] must be modified in an entry transaction. In addition, a symbol locking operation is carried out on this variable before the modification of a variable of class [C]. It is not necessary to declare table APLCOM in the processes ; the engine will read this table to fill the variables of class [C] as well as to automatically update the file once any change is made to the value of a class [C] variable.
Example : allocation of a chrono used in the construction of a process name for an import or export .
#-----------------#
$TR_NUMIMP
Trbegin APLCOM
Gosub MAJ_NUMIMP
Commit
Return
#-----------------#
$MAJ_NUMIMP
Lock NUMIMP
If fstat=0
NUMIMP = [C]NUMIMP
[C]NUMIMP += 1
If fstat : ER = 2 : Endif
Else
ER = 1
Endif
Return