Set Multiple Rows - GRID SENDMSG() Function 87

Syntax

TF$=SENDMSG(sysgui,id,87,starting_row,cell_contents${,context{,ERR=lineref}})

Description

This function sets the values in one or more contiguous cells with one command.

Parameter

Description

sysgui

SYSGUI channel.

id

Grid control ID.

87

Number of this SENDMSG() function.

starting_row

Starting row number (or column number if working with a column header grid). With the exception of column header grids, the starting column is always zero.

cell_contents$

Linefeed-separated strings with values to place in grid.

This function is supported only in Visual PRO/5 Rev 2.20 or later. Attempting to send this message to a grid control in an earlier version of Visual PRO/5 will generate an !ERROR=17 TCB(10)=3. This function is similar to Function 21 (Set Multiple Cells) but does not require that the cell pointer be moved to the starting cell.

When the function executes, the first value is placed in the first column of the starting row. Then the second value is placed in the next cell to the right. If the number of strings in cell_contents$ is greater than the number of columns in the grid, values will be set in the entire current row, then the next row or rows until last row is filled or all strings are used. Extra strings are ignored. If starting_row specifies a row or column that does not exist, VPro5 generates an !ERROR=17 TCB(10)=4.

The return value is a four-byte string that indicates the number of cells changed. The default style, alignment, and colors that can be changed with functions 55, 56, 83, and 84 are used. If any nondefault display attributes had been set in a cell with Draw Cell - SENDMSG() Function 54, those attributes are reset to the defaults by this function.

Example

The following example creates a grid with a column header, three rows, and two columns and fills in the column header grid:

sysgui=unt; open (sysgui)"X0"
print (sysgui)'window'(10,50,380,90,"Grid Example",$$)
print (sysgui)'grid'(100,10,10,360,75,$8042$,3,2,2,20,101)
result$=sendmsg(sysgui,101,87,0,"First"+$0A$+"Second")
escape

See Also

BBjStandardGrid::setCellText