"appendLines"
Appends several rows to a table.
Synopsis
1)
setValue (string shape, "appendLines", int number [, string
Name1, <dyn_anytype> Value1 [, string Name2,
<dyn_anytype> Value2... [, 0, dyn_int
rowFontType]]]);
shape.appendLines (int number, [ string Name1,
<dyn_anytype1> Value1 [, string Name2,
<dyn_anytype2> Value2... [, 0, dyn_int
rowFontType]]]);
2)
setValue (string shape, "appendLines", int number [, string
Name1, <dyn_dyn_anytype1> Value1 [, string Name2,
<dyn_dyn_anytype2> Value2... [, 0, dyn_int
rowFontType]]]);
shape.appendLines (int number [, string Name1,
<dyn_dyn_anytype1> Value1 [, string Name2,
<dyn_dyn_anytype2> Value2... [, 0, dyn_int
rowFontType]]]);
Parameters
Parameter | Description |
---|---|
shape | Name of the object |
number | Number of rows |
Name1 | Column name |
Value1 | Column contents |
rowFontType |
The font type. There are 4 different font types available: 0 = Normal (default) 1 = Bold 2 = Italic 3 = Italic bold |
Description
Adds one or more rows to the end of the table. The various calling options provide a choice of whether the rows contain values, values and colors or nothing. The values are passed as anytype dynamic arrays. If color information is also to be passed, then a dyn_dyn_anytype array must be used. The dyn_anytype array argument has three elements:
dyn_dyn_anytype[<anytype> Value[<string> bCol [<string> fCol]]
Value is the value to be set, bCol the background color and fCol the foreground color for a cell.
The function "appendLines" removes any previous table selection and any table sorting is ignored, that is, the cells are added to the end of the table. The parameter "rowFontType" enables the definition of a font type for the specific row.
Example
Example for a table called "table".
1. To append 4 empty lines:
table.appendLines(4);
2. To insert the first 5 values from the dyn_string array ds in the "Names" ; column:
table.appendLines(5,"Names",ds);
3. In this example, three rows with color values are added to the "Forename"; and "Surname"; columns of the table.
main()
{
shape table=getShape("table123");
dyn_string d1, d2, d3;
dyn_dyn_string fnam, snam;
// The entries in the Forename column d1=makeDynString("Peter","green","red");
d2=makeDynString("Martin","[100,50,50]","[25,60,100]");
d3=makeDynString("Christian","[50,50,50]","red");
// Transfer to the dyn_dyn array fnam[1]=d1;
fnam[2]=d2;
fnam[3]=d3;
// The entries in the Surname column d1=makeDynString("Baker","green","red");
d2=makeDynString("Miller","[100,50,50]","[25,60,100]");
d3=makeDynString("Smith","[50,50,50]","red");
// Transfer to the dyn_dyn array snam[1]=d1;
snam[2]=d2;
snam[3]=d3;
// Appending the three lines
table.appendLines(3,"Forename",fnam,"Surname",snam);
}
4. In this example, 3 values are entered in the "Names" ; column of the "table234" ; table.
main()
{
shape table=getShape("table234");
dyn_string tmp;
tmp[1]="Thomas";
tmp[2]="Marc";
tmp[3]="Peter";
table.appendLines(3, "Names", tmp);
}
Assignment
Table