SELBOX |
Selbox declares a selection box to enter a choice.
[ Local ] Selbox list_exprg [ Titled exp_title ] Using variable
|
Element |
Description |
Restrictions |
|
list_exprg |
List of expressions_généralisées separated by ','. |
The expressions must be alphanumeric and are limited to 255. |
|
exp_title |
Alphanumeric expression for the title of the box. |
length <= 50 |
|
variable |
numerical nom_de_variable including the selected number put in the box (that is the line number). |
The variable must exist. |
# variable result of the
choice
Libelle RESU
# display of the selection window
# with a list of expressions
# with cursor placed on the 5th element
$MENU
RESU=5
Selbox
& "element 1",
& "element 2",
& "element 3",
& "element 4",
& "element 5"
& Titled "Selection of elements"
& Using RESU
# action according to choice made
Case RESU
When 1 Gosub CHOIX1
When 2 Gosub CHOIX2
When 3 Gosub CHOIX3
When 4 Gosub CHOIX4
When 5 Gosub CHOIX5
When Default Goto MENU
Endcase
# variable result of the
choice
Integer RESU
# table of 1000 elements
Char V (15) (1000)
#filling table V
For I = 1 To 1000 Step 1
V (I-1) = "element "+num$(I)
Next I
# displays all the elements of the table V
Selbox V Titled "Selection
window" Using RESU
# displays a section of the table V
Selbox V(110..221) Titled "Selection
window" Using RESU
Selbox is used to declare a selection box to enter a choice from a finite selection. The operations for managing the box (display, selection and removal) will be automatic.
The instruction Selbox has as its first argument the list of choices to be displayed in the box. It is given as a list of alphanumeric expressions, each item in the list comprising one choice. If one of the expressions is a dimensioned variable without specifying index or range of indices all the elements in the variable are used. The index or range of indices specified determines the elements to be considered. If a range of indices is given, such that there is no corresponding element, for example CHOIX(1..0), the box will not be displayed.
Optional clauses may then be given:
The Titled clause is used give a title to the selection box.
The Using clause assigns the variable whose name follows, with the chosen number entered. Prior initialisation of this variable defines the active element when the box is displayed. The possible values are 1 for the first, 2 for the second, and so on to the last. The status variable is updated by entering a choice with the value '28'.
A selection box is closed as soon as a choice has been made.
The Close instruction does not exist for a Selbox.
|
Error |
Description |
|
ERMODE (10) |
- The Using clause variable is not
numerical. |
|
ERINDI ( 8) |
Error in limits for indices. |
|
ERDIM (55) |
Too many dimensions given. |
|
PLUMEM (31) |
No more memory available. |
|
ERTRWD (79) |
Too many screen-OBJects open. |
Inpbox - Dlgbox - Mesbox - Choose - Errbox - Infbox - Wrnbox - Qstbox - Status
|
|