Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

SetValue – PB Docs 150 – PowerBuilder Library

SetValue – PB Docs 150

SetValue method (DataWindows)

Description

Sets the value of an item in a value list or code table for
a column in a DataWindow control or DataStore. (A value list is
called a code table when it has both display and data values.) SetValue does
not affect the data stored in the column.

note.png SetValueByColNum

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

Controls

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore
object

Web

Server component

Web ActiveX

DataWindow control

Syntax

[PowerBuilder]

[Web DataWindow server component]

[Web ActiveX]

Argument

Description

dwcontrol

A reference to a DataWindow control or
DataStore.

column

The column that contains the value list
or code table. Column can be a column number
or a column name.

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

index

The number of the item in the value list
or code table for which you want to set the value.

value

A string whose value is the new value
for the item. For a code table, use a tab (~t in PowerBuilder) to
separate the display value from the data value (“Texas~tTX”). The
data value must be a string that can be converted to the datatype
of the column.

Return Values

Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, in PowerBuilder and JavaScript
the method returns null.

Examples

This statement sets the value of item 3 in the value
list for the column emp_state of dw_employee to
Texas:

This statement sets the display value of item 3 in
the code table for the column named emp_state of dw_employee
to Texas and the data value to TX:

The following statements use a SQL cursor
and FETCH statement to populate the ListBox portion
of a DropDownListBox style column called product_col of
a DataWindow object with code table values:

See Also

GetValue


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x