Value - DfBaseWindow
Gets and sets the data value for an object/item
Type: Property
Access: Read/Write
Data Type: String
Parameters: None
Parameters
| Parameter | Type | Description |
|---|---|---|
| iItem | Integer |
Syntax
Property String Value
| Access Type | Syntax |
|---|---|
| Read Access: | Get Value to StringVariable |
| Write Access: | Set Value to StringVariable/Value |
Description
Contains the value stored in the object. The value is often not an object property but rather an item property. This is why the first parameter is an item identifier. Many controls in Windows applications have only one item (item id = 0). These controls automatically use item zero if no item id is passed, Passing no item id passes the constant current_item which equals to -99 and it is the class responsibility to transform current_item to the correct item number (0 or whatever valid value).
An object need not be visible to set or get its value.
Use Changed_Value to set the value of a data entry object (DEO) if you want the new value to be saved (set the Changed_State of the DEO).
Sample
This sample shows how to set the value of a dbForm object.
set Value of dbForm1 to "John Smith"
Sample
This sample shows how to retrieve the value of a dbForm object into a string variable.
Procedure RetrieveValue
string sValue
get Value of dbForm1 to sValue
End_Procedure // RetrieveValue
Sample
This sample shows how to set the value of item 12 of a dbList object.
Procedure SetListValue
integer iItem
move 12 to iItem
set Value of dbList1 iItem to "John Smith"
End_Procedure // SetListValue
Sample
This sample shows how to retrieve the value of item 12 of a dbList object into a string variable.
Procedure RetrieveValue
string sValue
integer iItem
move 12 to iItem
get Value of dbList1 iItem to sValue
End_Procedure // RetrieveValue