FIELD |
"Field" defines elements in the list of fields and variables of the formula editor.
Field icon abbrev, parent_elt, child_elt, description, help, result
|
Element |
Description |
Restrictions |
|
abbrev |
abbreviation that describes the open box for the formula editor |
Maximum of 240 characters for all of the parameters |
|
icon |
Numeric expression that results in an icon number |
value between 0 and 30 |
|
parent_elt |
Alphanumeric expression that results in an identifier of the parent element |
|
|
child_elt |
Alphanumeric expression that results in an identifier of the child element |
|
|
description |
Alphanumeric expression that results in the description, which will be displayed in the list of fields and variables |
|
|
help |
Alphanumeric expression that results in the name of the HTML page to be displayed for the help |
|
|
result |
Alphanumeric expression that will be inserted into the formula if the element is selected |
|
#- Initilization of the
formula and opening of the formula editor
FORMULE = "date$"
Formula FORMULE As [FML]
#-
Declaration of the elements:
#- the ITMMASTER table at the 1st
level
#- the ITMREF, ITMDES, and ITMSHO
fields at the 2nd level
#- in the list of fields and variables
Field [FML] 4, "", "ITMMASTER",
"Table ITMMASTER", "", ""
Field [FML] 4, "ITMMASTER",
"ITMMASTER.ITMREF_0", "Product
ID", "",
"[F:ITM]ITMREF"
Field [FML] 4, "ITMMASTER",
"ITMMASTER.ITMDES_0", "Product
Description", "",
"[F:ITM]ITMDES"
Field [FML] 4, "ITMMASTER",
"ITMMASTER.ITMSHO_0", "Abbreviated title",
"", "[F:ITM]ITMSHO"
#- Display of
the formula editor
Boxact [FML]
$SAISIE
#- Entry in the formula editor
Boxinp [FML] Using REPONSE, FORMULE
Case REPONSE
When 1: Gosub VERIFICATION: Goto FIN
When 46: Gosub VERIFICATION
When 7: Goto FIN
When Default:
Endcase
Goto SAISIE
#-
Verification of the formula's valid structure -#
$VERIFICATION
E = abs(parse(FORMULE))
If E
Errbox errmes$(E)+chr$(13)+errm
Endif
Return
$FIN
#- Closing of the box
Boxclr [FML]
Close Local Inpbox [ZI1]
Close Local File [ZI1]
End
"Field" defines elements in the list of fields and variables of the formula editor. Since this is a hierarchical list, you will use this "Field" instruction to define each element - regardless of the hierarchical level.
The abrev parameter identifies the open box for the formula editor.
The icon parameter allows you to assign an icon for the element declared. This icon is often selected according to the element's hierarchical level If the value is zero (0), no icon will be displayed.
The parent_elt parameter is the identifier of the element from a higher hierarchical level to which the current element is attached. This parameter will then be left empty for all elements of the first hierarchical level.
The child_elt parameter is the identifier of the current element.
The description parameter contains the description that will be displayed in the list of fields and variables for the current element.
The help parameter is the identifier of the HTML page. This help will automatically be displayed at the bottom of the box when the element is selected and the "Display the Help" box is checked. The help is retrieved from the FLD directory, which is reserved for the on-line help.
The result parameter contains the expression that will be inserted in the formula when the element is selected. The percent sign (%) is not inserted in the formula, but allows you to place the cursor where the expression is in the formula editor.
The following statuses are returned after an entry in the formula editor:
|
Statuses |
Where-used |
|
1 |
returned by clicking on the "OK" button |
|
7 |
returned by clicking on the "Cancel" button |
|
46 |
returned by clicking on the "Verify" button |
|
47 |
returned by clicking on the
parent element without a child element |
It is preferable to apply the AFR data type to the field for the entry of a formula. This data type provides access to the formula editor in the right-click menu of the field and confirm the syntax of the formula entered. Five tables can be passed in parameters in order to load the list of fields and variables of the formula editor.
Formula - Boxact - Boxinp - Boxclr - Close - Status
|
|