XArrayDB Reference > XArrayDB Object Properties > Value Property (XArrayDB) |
Value Property (XArrayDB)
The Value property sets or returns the variant value of an individual XArrayDB element.
XArrayDB.Value (row, column) = variant
Arguments
row and column are long integer indexes identifying a particular array element.
Read/Write at run time. Not available at design time.
Property applies to XArrayDB object.
For instance, if x is a valid row index and y is a valid column index, the following statement assigns a string value to an individual element:
MyArray.Value(x, y) = "Hello"
Similarly, the following statement retrieves it:
s$ = MyArray.Value(x, y)
Note that the Value property is the default property for XArrayDB. Therefore, the preceding statements can be shortened to:
MyArray(x, y) = "Hello"
s$ = MyArray(x, y)
Example
Since the elements of an XArrayDB object are true variants, you can arbitrarily mix data types within a row (or column), as in the following example:
MyArray(1, 1) = "Hello" ' string
MyArray(1, 2) = 1.98 ' floating point
MyArray(1, 3) = 250000 ' long integer
MyArray(2, 2) = True ' Boolean
MyArray(2, 3) = LoadPicture("xyz.bmp") ' bitmap
Note: Although XArrayDB can be used to store picture data, True DBList's storage mode (DataMode 4) only accepts string and numeric data, and will not render XArrayDB picture data as an in-cell graphic. However, you can use the FetchCellStyle event to display XArrayDB picture data on a per-cell basis.
See Also