Set Single Cell - GRID SENDMSG() Function 22

Syntax

TF$=SENDMSG(sysgui,id,22,column_number,cell${,context{,ERR=lineref}})

Description

This function displays the value in cell$ in the specified column on the current row.

Parameter

Description

sysgui

SYSGUI channel.

id

Grid control ID.

22

Number of this SENDMSG() function.

column_number

Column number of the cell. (Column numbering is zero-based.)

cell$

Value to place in grid.

This function works on heading grids as well as main grids. The return value is a one-byte string that indicates the success or failure of the operation; $01$ indicates success, $00$ indicates failure. If column_number is higher than the highest column number in the grid, the function generates an !ERROR=17.

System default style, alignment, and colors are used. If any nondefault display attributes had been set in a cell with Draw Cell - Grid SENDMSG() Function 54, those attributes are reset to defaults by this function.

Example

The following example creates a grid and uses SENDMSG() Function 22 to display data in each column of each row:

let sysgui=unt; open (sysgui)"X0"
print (sysgui)'window'(50,50,200,150,"",$$,$$)
print (sysgui)'grid'(100,20,20,160,120,$9040$,3,3,3)
result$=sendmsg(sysgui,100,68,150/4,$$); rem row height
for col=0 to 2
result$=sendmsg(sysgui,100,36,col,chr(51)); rem column width
next col
result$=sendmsg(sysgui,100,57,0,$$); rem turn off color change highlighting
for row=0 to 2
tf$=sendmsg(sysgui,100,48,row,$$)
for col=0 to 2
tf$=sendmsg(sysgui,100,22,col,str(col))
next col
next row
escape

See Also

BBjStandardGrid::setCellText