XArrayDB Reference > XArrayDB Members > XArrayDB Object Properties > Value Property (XArrayDB) |
XArrayDB.Value (row, column) = variant
Read/Write at run time. Not available at design time.
Property applies to XArrayDB object.
Arguments
row and column are long integer indexes identifying a particular array element.
Description
The Value property sets or returns the variant value of an individual XArrayDB element. 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 DataControl's storage mode (DataMode 4) only accepts string and numeric data, and will not render XArrayDB picture data as an in-cell graphic.