QG_SetNumCells
QG_SetNumCells(areaRef; sizeExpression):errorCode | |||
---|---|---|---|
![]() |
areaRef | Longint | QGrid area reference |
![]() |
sizeExpression | Text | Expression giving the number of grid cells |
![]() |
error | Longint | Error result |
Set the 4D expression that calculates the grid size
Parameter areaRef is the QGrid area reference. If areaRef is not a valid QGrid area reference, qg_paramErr error is returned.
Parameter sizeExpression holds the 4D expression to be used for calculating the number of cells.
QGrid uses this expression to calculate how many cells the grid will contain, so the expression must return a long integer value.
If the number of cells changes while the plug-in area is running, inform the plug-in that it must recalculate the number of cells by calling QG_UpdateArea with the update type set to qg_Update_Grid.
Example
// Setup a grid to reflect the current selection of table [Photos]. C_LONGINT($err) C_TEXT($expression) $expression:="Records in selection([Photos])" $err:=QG_SetNumCells (xGrid;$expression) ASSERT($err=qg_noErr)
Related commands
QG_GetNumCells | Get the current grid size expression |
QG_UpdateArea | Trigger an update of the QGrid area content |