ui.ListBox.ForName() initializes the ui.ListBox object = binds a list box existing in a .fm2 form to the specified variable of the ui.ListBox type.
Syntax
LET <lbx_var> = ui.ListBox.ForName("lbx_id")
Arguments
lbx_id |
identifier of a list box existing in a .fm2 form (STRING) |
Usage and examples
Takes one argument - the identifier of a list box existing in a .fm2 form:
LET lbx= ui.ListBox.ForName("f1")
After initializing the ui.ListBox object, you can use other ui methods to manipulate this list box – both its contents and runtime appearance and behavior.
If you do not initialize the ui.ListBox object (bind it to the list box in a .fm2 form), you will not be able to manipulate this list box with ui methods.
If you omit the ui.ListBox.ForName() method or pass an empty argument to it and then refer to the ui.ListBox object at runtime, you will get a runtime error – 9043. Object not initialised (not usually fatal).:
LET lbx = ui.ListBox.ForName("")
If you pass a wrong argument (i.e. wrong list box identifier) to ui.ListBox.ForName(), you will get one of these results: