Cicode Programming Reference > Cicode Function Categories > Trend Functions Introduction > TrnSelect

TrnSelect

Sets up a page for a trend. This function allows you to set up a trend before the trend page is displayed. You can therefore use a single trend page to display any trend in the project by selecting the trend first, and then displaying the trend page. The PageTrend() function uses this function to display the standard trend pages.

Call this function and a set of TrnSetPen() functions before you display a trend page. When the trend page is displayed, all pens set by the TrnSetPen() functions are displayed. You can use the TrnSelect() function to configure different set of pens to be displayed on one generic trend page. The pen settings in the Page Trend database are overridden.

Note: Trend functions used after the TrnSelect() function needs to use the special value -2 as their AN. (See the example below).

Syntax

TrnSelect(Window, Page, AN [, ClusterName] )

Window:

The window number (returned from the WinNumber function).

-3 - for the current window.

-2 - for the next window displayed.

Page:

The name of the page that displays the trend.

AN:

The AN where the trend displays, or -3 for the first trend on the page.

ClusterName:

The name of the cluster that is associated with any trend tag for this trend graph. This is optional if you have one cluster or are resolving the trend via the current cluster context. The argument is enclosed in quotation marks "".

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

TrnSetPen, PageTrend, WinNumber

Example

TrnSelect(WinNumber(), "TrendPage", 40, "ClusterXYZ");
TrnSetPen(-2,1,"PV1");
TrnSetPen(-2,2,"PV2");
TrnSetPen(-2,3,"PV3");
TrnSetPen(-2,4,"PV4");
PageDisplay("TrendPage");

See Also

Trend Functions