"lineParam";

Changes the cell attributes in certain rows depending on their contents.

Synopsis

setValue(string shape, "lineParam", int n, string spName1, <type1> spValue1 [, string spName2, <type2> spValue2, ...] string sWord1, dyn_string spColumn1, <dyn_anytype> spData1 [, string sWord2, dyn_string spColumn2, <dyn_anytype> spData2 ...]);

shape.lineParam(int n, string spName1, <type1> spValue1 [, string spName2, <type2> spValue2, ...] string sWord1, dyn_string spColumn1, <dyn_anytype> spData1 [, string sWord2, dyn_string spColumn2, <dyn_anytype> spData2 ...]);

Parameters

Parameter Description
shape Name of the object
n Number of key columns
spName1 Names of the key columns
spValue1 Contents of the key columns
sWord1 Key words: "value", "foreCol" or "backCol"
spColumn1 Array containing all columns to be changed
spData1 The attribute values (the type depends on the keyword) that will be set in all columns listed in spColumn1

Description

This function allows making targeted changes to cell attributes, that is, contents, foreground color and background color. What rows or cells will be changed can be set by conditions relating to the contents of the cells. These conditions are defined by two parameters, the name of the column to be checked ("spName") and its contents ("spValue"). If the contents of a column match the specified "spValue";, then the condition is met. Any number of key columns can be read. Their number simply needs to be passed as the first argument of the function ("n").

If all n conditions have been met, then a specified attribute will be changed for the topmost row meeting all conditions.

The attribute concerned is defined by the parameter "sWord" that can take the values "value"; (contents), "forecol"; (text or foreground color) or "backCol"; (background color).

The attributes will be changed in all columns specified in the dyn_string "spColumn"; to the values contained in "spData";. Remember that dynamic arrays of color strings must be passed for "backCol"; and "foreCol"; whereas no specific data type is expected for "value";.

Furthermore, in rows whose columns contain different data types, different dynamic arrays must be sent, each starting with a key word "value";.

Example

In this example, the name "Peter Miller" is looked for in the columns "Forename"; and "Surname"; in "table123";. If the search criteria match, the values in the columns "Age"; and "Salary"; will be set to the values "35" and "25000", respectively.

main()
{
  shape table=getShape("table123");
  dyn_string d1;
  dyn_int d2;
  d1=makeDynString("Age", "Salary"); // Columns
  d2=makeDynInt(35, 25000); // Contents
  table.lineParam(2, "Forename", "Peter", "Surname", "Miller", "value", d1,d2);
}

Assignment

Table