Skip to main content
Version: Next

OBJECT Get list name

OBJECT Get list name ( {* ;} object {; listType} ) -> Function result

ParameterTypeDescription
*Operator🡒If specified, object is an object name (string)
If omitted, object is a variable or a field
objectForm object🡒Object name (if * is specified) or
Variable or field (if * is omitted)
listTypeLongint🡒Type of list: Choice list, Required list or Excluded list
Function resultText🡐Name of list (specified in Design mode)

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:

ConstantTypeValueComment
Choice listLongint0Simple list of values to choose from ("Choice List" option in the Property List) (default)
Excluded listLongint2Lists values not accepted for entry ("Excluded List" option in the Property List)
Required listLongint1Lists 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 ("").

See also

OBJECT Get list reference
OBJECT SET LIST BY NAME