## The `value' property

0 or 1 for Check, Radio ToolButton or Menu
An integer scalar or vector for a List or Combo
An integer scalar for a Selector, Spinner or Trackbar
An integer vector for Scroll or Progress
An integer scalar for a Tree
For a Grid, a character vector or numeric scalar for each cell.

Valid for: List, Combo, Check, Radio, ToolButton, Menu, Scroll, Progress, Selector, Tree
Cell property for a Grid object

The `value` property contains the current selected value of the control to which it relates. For a Menu item, Check box, Radio button or ToolButton, this is 0 if the control is not selected and 1 if it is selected. If you set a Radio button's or ToolButton's `value` to 1, any other Radio button or ToolButton in the same group is switched off, and an `onClick` event is generated. Setting the `value` property of a Check box to 0 or 1 also generates an `onClick` event.

For a List or Combo, the `value` property contains the number (in index origin 1) of the selected item or items (if any). For a single-select list box, it is a vector of length 0 (if no item is selected) or 1 (if an item is selected). For a multi-select list box, it is a vector of arbitrary length. Again, setting the `value` property of a List generates an `onClick` event.

For a Spinner or Trackbar, the `value` property is an integer scalar representing the currently-selected value.

For a Selector, the value property holds the index (starting at 1) of the currently-displayed page, or 0 if none.

For a Tree object, the `value` property holds the ID of the currently-selected node

For a Progress or Scroll bar, the `value` property is a four- or five-element vector, as follows

[1] Current value (initially 0)
[2] Maximum value (default 100)
[3] 'Page' increment (default 1)
[4] Minimum value (default 0)
[5] Scroll bar only (Reserved: 0)

When setting this property, you do not have to set all elements.

#### Grid object `value` cell property

When you read this cell property for a Grid object, it returns a character vector for each Text cell and a numeric scalar for each Numeric cell, for each cell in the list of rows and columns specified. If a Numeric cell is invalid, it will return the current `conversionerrorvalue`. If you read a set of cells some of which are Numeric and some Text, it will return a nested array containing a mixture of character vectors and numeric scalars. If you read a set of cells all of which are Numeric, it will return a simple numeric array.

When you write to this cell property for a Grid object, it sets the value for each cell in the list of rows and columns specified. If you supply a number for a cell, that cell becomes a Numeric cell. If you supply a character vector or scalar, it becomes a Text cell. Writing to a cell also causes its `valid` property to be set to 1.

Although `value` is a cell property for a Grid object, as a convenience you can read (but not write to) `value` as a simple property of the Grid object. It returns the value of the currently-active cell. If the cell is a text cell, it will return a character vector. If it is a numeric cell, it will return the numeric value of the cell, or (if the cell is invalid) the current `conversionerrorvalue`.

Topic: APLX Help : System Classes : Properties : value

[ Previous | Next | Contents | Index ]