The OBJECT Get list name command returns the name of the choice list associated with the object or group of objects designated by object. 4D lets you associate a choice list (created with the choice list editor in Design mode) with form objects using the form editor or the OBJECT SET LIST BY NAME command.
If you pass the optional * parameter, you indicate that the object parameter is an object name (string). If you do not pass this parameter, you indicate that the object parameter is a field or a variable. In this case, you pass a field or variable reference (object field or variable only) instead of a string.
You can use the optional listType parameter to designate the type of list that you want to get. By default, if you omit this parameter, the command returns the name of the choice list (list of values) associated with the object. You can also get the names of required lists or excluded lists by passing, in listType, one of the following constants found in the "Form Objects (Properties)" theme:
Constant |
Type |
Value |
Comment |
Choice list |
Longint |
0 |
Simple list of values to choose from ("Choice List" option in the Property List) (default) |
Excluded list |
Longint |
2 |
Lists values not accepted for entry ("Excluded List" option in the Property List) |
Required list |
Longint |
1 |
Lists only values accepted for entry ("Required List" option in the Property List) |
If there is no list of the type defined associated with the object, the command returns an empty string ("").