Have a Question?
Print

00731: Setting Multiple Row Values for the Grid Control

Title:

Setting Multiple Row Values for the Grid Control

Description:

Set Multiple Rows – SENDMSG() Function 87 
(Rev 2.11 or later) 


Syntax 

TF$=SENDMSG(sysgui,id,87,starting_row,cell_contents$) 

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

Parameter         Description 
sysgui                  SYSGUI channel. 
id                  Grid’s control ID. 
87                  SENDMSG() function number. 
starting_row         Starting row number (or column number if working with a column header) 
cell_contents$         Linefeed-separated strings with values to place in grid. 

This function is supported only in VPro5 Rev 2.11 or later. 

Attempting to send this message to a grid control in an earlier version of VPro5 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. 

The starting_row parameter specifies the starting row number (zero based) or column number if sending to a column header grid. With the exception of column header grids, the starting column is always zero. 

The cell_contents$ parameter contains one or more strings delimited by linefeeds ($0A$) or nulls ($00$). 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 which 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 



Last Modified: 08/19/1999 Product: Visual PRO/5 Operating System: Windows

BASIS structures five components of their technology into the BBx Generations.

Table of Contents
Scroll to Top