4D v17

WP Table get rows

Home

 
4D v17
WP Table get rows

WP Table get rows 


 

WP Table get rows ( tableRef ; startRow {; numRows} ) -> Function result 
Parameter Type   Description
tableRef  Object in Table reference
startRow  Longint in Position of first row
numRows  Longint in Number of rows to get
Function result  Object in New table range containing selected rows

The WP Table get rows command returns a new cell range object containing the selection of tableRef rows defined by startRow and numRows

The startRow parameter points to the first table row to return, and the optional numRows parameter specifies how many rows to return. If numRows is omitted, the single startRow row is returned.
If startRow plus numRows exceed the number of rows in tableRef, or if startRow is greater than the number of rows in tableRef, the returned range contains the maximum possible rows.

You want to set a specific background color for the first two rows of a table, and modify the border of the third row:

 C_OBJECT($wpTable;$wpRange;$wpRow1;$wpRow2;$wpRow3;$wpRow4;$wpRow5;$rows;$rows2)
 $wpRange:=WP Create range(WParea;wk start text;wk end text)
 
 $wpTable:=WP Insert table($wpRange;wk append)
 $wpRow1:=WP Table append row($wpTable;"Paul";"Smith";25)
 $wpRow2:=WP Table append row($wpTable;"John";"Richmond";40)
 $wpRow3:=WP Table append row($wpTable;"Mary";"Trenton";18)
 $wpRow4:=WP Table append row($wpTable;"Christopher";"Lee";53)
 $wpRow5:=WP Table append row($wpTable;"Henry";"Cartier";42)
 
 $rows:=WP Table get rows($wpTable;1;2)
 WP SET ATTRIBUTES($rows;wk background color;0x00E0F0FF)
 $rows2:=WP Table get rows($wpTable;3)
 WP SET ATTRIBUTES($rows2;wk border style;wk solid)
 WP SET ATTRIBUTES($rows2;wk border width;4)

 

To get a range of rows starting from the 10th to the end:

 WP Table get rows(tableRef;10;MAXLONG)



See also 

WP Insert table
WP Table append row
WP Table get cells
WP Table get columns

 
PROPERTIES 

Product: 4D
Theme: 4D Write Pro Language
Number: 1475

This command can be run in preemptive processes

 
HISTORY 

New
Created: 4D v16 R4
Modified: 4D v17

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v17)