SEL_TABLE

Description

This action is called at the very start of the template, before the display of the selection window.

Template

Selection on table

Use

It mainly serves to construct the selection window. There are two possibilities to prepare this window :

   either make to a call to the principal selection window defined in the OBJect (this is feasible if the table to be explored is managed by an OBJect)

   or totally construct this selection window.

It can serve to interrupt the process by setting OK = 0.

It can serve to modify the number of elements to be displayed in the selection window, by modifying the variable adxmxl. It is not necessary to back it up, the supervisor does this.

example call to the OBJect selection window.

This is the simplest case. The OBJect parameters are used to display the principal window of this OBJect. The variables to be entered are as follows  :

   OBJET : Char, length 5.
It is used to identify the OBJect, in order to recover the information necessary for the display of the window.
It is mandatory to enter this variable.

   SUPP : Char, length 30.
When the OBJect has 2 key elements it is used to filter the records in the table on a value of the 1st key field.
Therefore, if this filter is to be used, this variable is entered with the value of the 1st field of the key.

   OPTIONS : Char, length 10.
It is used to filter the records in the pre-defined filter in the OBJect. The "Selection filter" codes defined in the OBJect that they are to be applied in are entered here.
By adding the "#" character, the active records are filtered (that is to say those where the field [F]ENAFLG=2) and the action FILTRE for the OBJect is executed.
By adding the character "|", the records are sorted on the 1st key field then the 2nd. 
By adding the character "$", The OBJect table is opened with the abbreviation from the dictionary, even if it is already opened. It is used to avoid the residual filters or a resetting of the [F]

case for the creation of a selection window

In this case, the window is to be contracted, completely. It is necessary to open (if it is not already) the table in which the selection is based. It is also necessary to specify that this [F] class is the default class. There is a limit of 16 columns in the construction of the window. To define the window, the following variables are available :

   NBCOL : Integer
This is the number of columns to be displayed in the window. The number of columns is limited to 16. 

   TIT(NBCOL) : Char, length 30, sized.
This is the column title. It is to be entered for each column planned in the window.

   COL(NBCOL) : Char, length 50, sized.
This is the name of the field to be displayed in the column. It is to be entered for each column planned in the window.

   TIT(0) : Char, length 30.
This is the title of the window.

In both cases :

It is possible to modify the default values for the following variables :

   ORDRE : Char, length 250.
It is used to indicate the sort order for the records.
When it involves a window coming from an OBJect, the supervisor sorts on the key specified in the "selection" tab if not sort on the primary key. 
When the key is not specified in the OBJect "selection" tab, the supervisor will take the primary key. When this primary key is composed of two elements, the supervisor sorts, by default, on the last element or even on all of the key if OPTIONS="|" in this action.

When in a constructed window, the supervisor sorts, by default, on the records in the first column declared in the window.

This variable gives the possibility to sort the records in another way. Indicate in this variable the name of one or more fields belonging to the table but not necessarily the window. The names of the fields are separated from each other with the character ";".
For instance: ORDRE = "[F:ADI]NUMTAB;[F:ADI]CODE"

   SENS : Integer
It is used to indicate the sense of the sort for the records.
By default, the sort is ascending. The value will be specified in this variable in order to have a descending sort.

   START : Char, length 250.
It is used to identify the column that will load the field in which the window has been activated, when the user has made their choice.
When in a window coming from an OBJect, the supervisor takes by default the field of the primary key. For a key with 2 components, the supervisor takes by default, the second key element if not it takes the first when the user specifies OPTIONS="|" in this action.
When in a constructed window, the supervisor takes by default, the first column declared in the window.
This variable gives the possibility of using another column. The name of the field appearing in the window is indicated in this variable.

   EXPSTART : Char, length 250.
It is used to indicate the record on which the cursor will be positioned.
By default, the cursor will be set on the first record where the field identified by the START variable is greater than or equal to the value entered. However, it is possible to indicate the placing of the cursor by its own expression.

   CRITERE (1..3) : Char, length 250.
these fields are used to indicate a selection filter for the records in the table.

   SIZLIG & SIZCOL : integer
they are used to modify the size of the window that is 10 lines and 60 columns by default.
These two variables are initialised in the following way: SIZLIG = 80 & SIZCOL = 240.
SIZLIG indicates a number of lines expressed in 1/8 of a line.
SIZCOL indicates a number of columns expressed in 1/4 of a column.