OBJECT Get list name
OBJECT Get list name ( {* ;} object {; listType} ) : Text
Parameter | Type | Description | |
---|---|---|---|
* | Operator | → | If specified, object is an object name (string) If omitted, object is a variable or a field |
object | any | → | Object name (if * is specified) or Variable or field (if * is omitted) |
listType | Integer | → | Type of list: Choice list, Required list or Excluded list |
Function result | Text | ← | Name of list (specified in Design mode) |
This command is not thread-safe, it cannot be used in preemptive code.
Description
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 | Integer | 0 | Simple list of values to choose from ("Choice List" option in the Property List) (default) |
Excluded list | Integer | 2 | Lists values not accepted for entry ("Excluded List" option in the Property List) |
Required list | Integer | 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 ("").