ClearValues

Description

Deletes all the items from a value list or code table associated with a DataWindow column. (A value list is called a code table when it has both display and data values.) ClearValues does not affect the data stored in the column.

NoteClearValuesByColNum A separate method name is provided as an alternative syntax for the Web DataWindow server component, which cannot use overloaded methods.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore object

Web

Server component

Web ActiveX

DataWindow control

Syntax

PowerBuilder

integer dwcontrol.ClearValues ( string column )
integer dwcontrol.ClearValues ( integer column )

Web DataWindow server component

short dwcontrol.ClearValues ( string column )
short dwcontrol.ClearValuesByColNum ( short column )

Web ActiveX

number dwcontrol.ClearValues ( string column )
number dwcontrol.ClearValues ( number column )

Argument

Description

dwcontrol

A reference to a DataWindow control or DataStore.

column

The column whose value list you want to delete. Column can be a column number (integer) or a column name (string). For the Web DataWindow server component, when the column is a number, use the ClearValuesByColNum method.

Returns

Returns 1 if it succeeds and –1 if an error occurs. The return value is usually not used.

Usage

The edit style of the column can be DropDownListBox, Edit, or RadioButton. ClearValues has no effect when column has the EditMask or DropDownDataWindow edit style.

Examples

Example 1

This statement clears all values from the drop-down list of dw_Employee’s status column:

dw_Employee.ClearValues("status")

See also