XArrayDB Reference > XArrayDB Properties > Value Property (XArrayDB) |
Sets or returns the value of an individual array element.
XArrayDB.Value (row, column) = variant
row and column are long integer indexes identifying a particular array element.
Read/Write at run time. Not available at design time.
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:
Similarly, the following statement retrieves it:
Note that the Value property is the default property for XArrayDB. Therefore, the preceding statements can be shortened to:
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(2, 3) = LoadPicture("xyz.bmp")
Although XArrayDB can be used to store picture data, True DBGrid'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.