FindSeries PowerScript function
Description
Obtains the number of a series in a graph when you know the
series’ name.
Controls
Graph controls in windows and user objects, and graphs in
DataWindow controls
Syntax
|
1 |
<span>controlname</span>.<span>FindSeries</span> ( { <span>graphcontrol</span>, } <span>seriesname</span> ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph containing the |
|
graphcontrol (DataWindow control |
(Optional) A string whose value is the |
|
seriesname |
A string whose value is the name of the |
Return Values
Integer. Returns the number of the series
named in seriesname in the graph controlname,
or if controlname is a DataWindow control,
in graphcontrol. If an error occurs, FindSeries returns
-1. If any argument’s value is null, FindSeries returns null.
Usage
Most of the series manipulation functions require a series
number, rather than a name. However, when you delete and insert
series, existing series are renumbered so that the series are numbered
consecutively. Use FindSeries when you know only
a series’ name or when the numbering may have changed.
Examples
These statements store the number of the series in
the graph gr_product_data that
was entered in the SingleLineEdit sle_series in SeriesNbr:
|
1 |
integer SeriesNbr |
|
1 |
SeriesNbr = & |
|
1 |
gr_product_data.<span>FindSeries</span>(sle_series.Text) |
These statements obtain the number of the series
named PCs in the graph gr_computers in
the DataWindow control dw_equipment and
store it in SeriesNbr:
|
1 |
integer SeriesNbr |
|
1 |
SeriesNbr = & |
|
1 |
dw_equipment.<span>FindSeries</span>("gr_computers", "PCs") |