INSERT LISTBOX COLUMN FORMULA

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 11


INSERT LISTBOX COLUMN FORMULA ({*; }object; colPosition; colName; formula; dataType; headerName; headerVariable)

ParameterTypeDescription
**If specified, object is an object name (string)
If omitted, object is a variable
objectForm objectObject name (if * is specified) or
Variable (if * is omitted)
colPositionNumberLocation of column to insert
colNameStringName of the column object
formulaString4D formula associated with column
dataTypeLongintType of formula result
headerNameStringName of the column header object
headerVariableInteger variableColumn header variable

Description

The INSERT LISTBOX COLUMN FORMULA command inserts a column into the listbox designated by the object and * parameters.

The INSERT LISTBOX COLUMN FORMULA command is similar to the INSERT LISTBOX COLUMN command except that it can be used to enter a formula as the contents of a column.

This type of contents can only be used when the "Data Source" property of the list box is set to Current Selection or Named Selection (for more information about this, please refer to the Managing List Box Objects section).

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 variable. In this case, you do not pass a string but a variable reference. For more information about object names, please refer to the Object Properties section.

The new column is inserted just before the column designated by the colPosition parameter. If the colPosition parameter is greater than the total number of columns, the column will be added after the last column.

Pass the object name of the inserted column in the colName parameter.

The formula parameter can contain any valid expression, i.e.:

An instruction,

A formula generated using the Formula editor,

A call to a 4D command,

A call to a project method.

At the moment the command is called, the formula is parsed then executed.

Note: Use the Command name command in order to define formulas that are independent from the application language (when they call on 4D commands).

The dataType parameter can be used to designate the type of data resulting from the execution of the formula. You must pass one of the following constants of the "Field and Variable Types" theme in this parameter:

ConstantTypeValeur
Is RealLongint1
Is TextLongint2
Is PictureLongint3
Is DateLongint4
Is BooleanLongint6
Is TimeLongint11

If the result of the formula does not correspond to the expected data type, an error is generated.

In the headerName and headerVariable parameters, pass the object name and variable of the column header inserted.

Note: Object names must be unique in a form. You need to make sure that the names passed in the colName and headerName parameters are not already used. Otherwise, the column is not created and an error is generated.

Example

We want to add a new column to the right of the list box that will contain a formula which calculates an empolyee's age:

   vAge:="Current Date-[Employees]BirthDate)\365"
   $last:=Get number of listbox columns(*;"ListBox1")+1
   INSERT LISTBOX COLUMN FORMULA(*;"ListBox1";$last;"ColFormula";vAge;Is Real;"Age";HeaderVar)

See Also

INSERT LISTBOX COLUMN.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next