AMT Help Files

FILLBOX

Syntax

Command
Mandatory parameter
Optional parameter
Mandatory keyword
Optional keyword

FILLBOX (<Fieldname>, <Value>)

Description

With the FILLBOX statement, you can fill listboxes or comboboxes through a text file instead of doing this directly through the memory. This is only supported if the MemoryBased property has been set to false. Other than with the ATTACHTOBOX command, the file is created and maintained by AMT automatically.

Diagram

Returned value type

None

Parameters

Parameter Description
<Fieldname>

The name and location of a layout control element. The syntax for a fieldname is as follows:
'<Formname>.[<Occurs>]<Layout fieldname>'
Where:
<Occurs> is the value to indicate which element for the specified layout control has to be filled. The syntax for <Occurs> depends on the settings of the OccursData property:

  • For controls with only vertical occurrences, xx should be used. E.g.  fillbox ('FORM_BOXES.' + '02' + 'combo_cntry_code', name-2) will use the 2nd vertical control.
  • For controls with only horizontal occurrences, xxxx should be used. E.g.  fillbox ('FORM_BOXES.' + '0003' + 'combo_cntry_code', name-2) will use the 3rd horizontal control.
  • For controls with both vertical and horizontal occurrences, xxxx_xxxx should be used, where the numbers before the underscore (_) is the vertical occurrence and the number after the underscore is the horizontal occurrence.  E.g.  fillbox ('FORM_BOXES.' + '0001_0002' + 'combo_cntry_code', name-2) is the control in the 1st column, 2nd row.
To avoid overlapping when opening listbox or combobox elements it is important to choose a suitable setting for the vertical offset.

<Formname> is the name of the form. Instead of a specific formname, the asterisk (*) can be specified to assign all forms.
<Layout fieldname> is the name of the listbox or combobox within the specific form or all the forms (depending on <Formname>) to which the values are inserted.
<Value> Expression giving the string to assign one or more columns to the specified listbox(es) or combobox(es). The syntax to specify a single row is as follows:
<Delimiter>' + <Item value> + '<Delimiter>' + <Itemname>

<Delimiter>
Separates the values to send from the items to display within the string.
The character to use as a delimiter is free. to choose The first used character within the value is considered to be the delimiter. It is important that you make sure that this character is not used in the values. It is recommended to use a vertical bar/pipe character (|) as delimiter.

<Item value>
Value sent to the application code.

<Itemname>
Itemname that is displayed to the end user in the list/combo box.

To add an empty line, you have to specify just the delimiters.


Remarks

To assign multiple columns or rows within the specification, delimiters are used. Note that each row in a box item is first filled with a value that is used within the program (column that is referred to by the property ValueSend of the box item) and one or more items that is/are shown to the user (column that is referred to by the property ItemsDisplayed of the box item).
This command is normally used in combination with the LOOP...ENDLOOP command.

The fieldname is defined as '*.combo_cntry_code', to allow the file to automatically populate any list/combo boxes with the same name in other forms. Due to the fact that an asterisk can actually not be used in a windows file name, the actual name of the file created will be an underscore and the extension will be the field name specified, e.g. '_.combo_cntry_code'.

The encoding of the listbox file created by the fillbox command is either ASCII or Unicode, depending on the application option 'Define Unicode for all extracted files'.

When specifying an empty string in the fillbox command (e.g. fillbox ('*.combo_cntry_code', '') ), the listboxfile will be removed and the list/combobox will show empty.

By default listbox files are available to all users, this behaviour can be changed with the Application option: 'Create listbox file only in Station folder with Fillbox'.

Example

teller := 0
loop for teller := 1 to 5
   name-2 := '|' + teller + '|' + teller + ' aha'
   fillbox ('FORM_BOXES.' + '02' + 'combo_cntry_code', name-2)
endloop

 

Return to

Commands