CHOOSE |
Choose is used to select recordings in a grid, via a window.
Chooseclass[ Where Where_exp] [ Order by Order_by_exp ]Using field_list[ Sized dimension ][ Titled box_title ][ Starting At Start_exp ]
|
Element |
Description |
Restrictions |
|
class |
Abbreviation of an open file |
the file must be already open. |
|
Where_exp |
selection_expression. See Where |
None. |
|
Order_by_exp |
Key_expression See Order |
None. |
|
field_list |
List of fields separated by the character ','. |
16 maximum fields |
|
field |
Identifier of a field under the following form : |
|
|
field_title |
Alphanumeric expression for the field title |
|
|
dimension |
Size of the selection box on the screen in the form : |
This position must not exceed the limits of the screens. |
|
nb_lin |
Integer expression giving a number of lines |
|
|
nb_col |
Integer expression gives a number of columns |
|
|
box_title |
Alphanumeric expression for the box title. |
|
|
Start_exp |
logical_expression specifying the recording on which the cursor must be positioned. |
None. |
#opening the work table
If !clalev([F:ZMS]): Local File ACTIVE [ACV]: Endif
# displaying all the recordings of the table
# in the ascending order of the product references
Choose [ZMS]
& Order By evalue("YITMREF") Using
& [ZMS]YITMREF Titled "Article",
& [ZMS]YITMDES Titled "Intitulé",
& [ZMS]YBASPRI Titled "Prix",
& [ZMS]YVATRAT Titled "Taux"
& Sized(80,240)
& Titled "boite de sélection"
# displaying the recordings in the table
# from the one showing prices smaller than €100
# sorted out by price, in decreasing order
# by positioning the cursor on the 1st product reference starting with "L" with a price > 60
Choose [ZMS]
& Where ([F:ZMS]YBASPRI < 100)
& Order By evalue("YBASPRI") Desc Using
& [ZMS]YBASPRI Titled "Price",
& [ZMS]YITMREF Titled "Article"
& Sized(80,240)
& Titled "Since last choice, and price < €100"
& Starting At [ZMS]YITMREF >= "L" and [ZMS]YBASPRI > 60
Choose is used to open a window on a list of recordings extracted from a table, and to select a recording. This instruction is normally used in the selection process of a field defined in a mask, in order to perform an entry in a list, but it can also be used in any process, and disconnected from any entry statement.
The file in which the selection operates must have been opened by the File or Local File instruction. In particular, it can result from the execution of a system order, as it is allowed by the Fil instruction.
The Where clause, that is optional, defines the criteria to be checked by recordings in order to appear in the selection window. If it is absent, only the first 255 recordings in the table can be chosen. The selection criteria defined in Choose are added to those of the File instruction when the latter contains some, or to the last Filter.
The Order By clause defines the order in which the information will appear in the mask. Specifying a number of key parts makes it possible to limit the read of the recordings to the first encountered one (in the case of possible homonyms) for each new value taken by the key (on the given number of components). In the absence of any Order By clause, Adonix will determine the key that will be used, based on the Where clause. For System type files, for which no key can be defined, the recordings follow the order in which they would have appeared via the Unix command.
The Using clause is used to define the table fields that will be viewed in the selection window.
Choose loads a maximum of 255 recordings in the mask. Then the cursor positions itself inside the selection window on:
The clause Sized is used to give a dimension to the selection box.
The clause Titled is used to give a title to the selection box.
Choose updates the fstat variable which is equal to 0 when there are elements to be selected, or to 4, which means that the file is 'empty' (based on the selection criteria provided or else without any recording).
If the file is 'empty', the selection window does not open and the S]status variable remains set to 0.
The selected recording becomes the current recording and the variables of class [F] (like those of class [G]) contain the values that correspond to this recording.
The status system variable returns the output status of the selection. status is equal to 28 if a recording has been selected.
The selection boxes are closed once the choice is made. The Close instruction does not exist for a Choose.
|
Error |
Description |
|
ERCLAS (7) |
The file is not open. |
WHERE - ORDER - STATUS - SELBOX - INPBOX - DLGBOX - MESBOX
|
Copyright © Sage 1999 - 2007 |