ATTACHTOBOX
Syntax
![]()
Command
Mandatory parameter Optional parameter Mandatory keyword Optional keyword |
ATTACHTOBOX (<Fieldname>, <Filename>)
Description
With the ATTACHTOBOX command, you assign the content of an existing contents file, of any name, to a list- or combobox on a form. This will only be supported if the Memory Based property for that particular control has been set to false in the object inspector.
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> 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. |
<Filename> | Expression giving the name of the textfile (that is considered as a single string) from which the data
is read. It is also possible to use a file ID as filename if the file ID has a physical file location set. The file will then be copied to the default listbox folder as set in the basepath. |
Remarks
The file is read and the list/combo box(es) is/are filled with the content of that file. Within the file, delimiters are used to define which value must be placed where. This file should be located in the listbox folder as set in the basepath.
The ATTACHTOBOX command can be used to fill the listbox or combobox with the file that applies only to a specific user who is logged on, and a different file can be made for each user depending on the users rights. The files can be updated during the night. This way the users will always have the most recent information at hand.
If you prefer to let AMT handle the files, and you don't want to point to a specific file, you can use the FILLBOX command. However, the ATTACHTOBOX command will always give a better performance result.
Example
| ordjan | Orders January
| offjan | Offers Janyary
| ordfeb | Orders February
| offfeb | Offers February
attachtobox ('*.lbxselproduct', 'FieldContent.txt')
// All the layout controls that are called "lbxselproduct"
// are filled with the content of the file "FieldContent"