ProvideX V8.20 > Language Reference > 2. Directives
150
To determine which cells are selected: use GRID SELECT READ to obtain the first
selected cell, then use GRID SELECT READ NEXT to get subsequent cells.
Reminder: If you use a zero (0) in both col and row, ProvideX interprets that to mean
"all cells" and will select the entire grid.
GRID SELECT ctl_id,col,row[,width,height][,ERR=stmtref]
Select Range. This format selects a range of cells from your grid.
GRID SELECT READ ctl_id,col,row[,ERR=stmtref]
Select Read. Use this to read the first selected cell. If the cell doesn't exist, ProvideX
returns Error #11: Record not found or Duplicate key on write.
GRID SELECT READ NEXT ctl_id,col,row[,ERR=stmtref]
Select Read Next. Use this format to read the next (not the first) selected cell. When
ProvideX encounters a GRID SELECT READ NEXT after the last selected cell is
returned, it reports
Error #2: END-OF-FILE on read or File full on write.
GRID SELECT RESET ctl_id[,ERR=stmtref]
Select Reset. This format removes all cells from the SELECT state. There is no way to
remove cells from the selected state individually.
Format 18: Find or Retrieve
GRID FIND ctl_id,col,row,var$[,ERR=stmtref]
Use a string var$ in the GRID FIND format to return the value for a specific cell.
Format 19: Write Setting
GRID WRITE ctl_id,col,row,contents$[,ERR=stmtref]
Use GRID WRITE to update your grid by writing settings to specified cells.
Reminder: If zero (0) is used for both col and row, then the value specified in
contents$ will be written to each cell in the grid.
Format 20: Report all Changes
GRID AUTO ctl_id[,ERR=stmtref]
Use this format to have ProvideX return a CTL value whenever the current selection is
changed. You can use the values in your applications to track a users' selections.
Example
The example on the following page demonstrates how you can use a combination of
GRID directives and GRID control object properties to perform various functions
(formatting, loading, retrieving, etc.).