Used this function to access a value in a series that is passed to Script-Object function.

 

Access to a series is defined as follows:

Auto-Indexed properties or Auto-Index series are offset based.

Non-Auto-indexed series are manual direct index based.

 

Access to any series to be passed requires the use of the AsSeries() function.

 

Script-Object parameters are numbered by their sequence location in the left-to-right order in how they appear in the script.Execute() call statement.  

 

See Custom Parameters for more details.

 

Syntax:

y = script.GetSeriesValue( SeriesParameterNumber, offsetOrIndex )

 

Parameter:

Description:

SeriesParameterNumber

Series parameter sequence location number.  

offsetOrIndex

Element offset for use with Auto-Index series, or a series element index for use with Manually index series.

 

Example:

'  ----------------------------------------------
'  AsSeries() function to send is required when a series,
'  is passed as a Script-Object parameter.  AsSeries()
'  passes the series memory location.  Without the
'  AsSeries() function only the value of an element is
'  passed and other elements will not be accessible.
'  ----------------------------------------------
 
'  Count the number of series parameters
x = script.seriesParameterCount
 
SetSeriesSize( testSeries, 10 )
For i = 1 TO 10
   testSeries[ i ] = Random( 100 )
Next
 
For i = 1 TO 10
  PRINT i, "Series Value", testSeries[ i ], _
            script.Execute( "SeriesExample", _
                            AsSeries( testSeries ), i )
Next

'  ----------------------------------------------

Note:

Earlier version of GetSeriesValue() required a "-1" added to the users offset to get the correct series element.  This next example shows how to adjust the offset:
'  SeriesExample is defined as:
  script.SetReturnValue( script.GetSeriesValue( 1, x-1 ))

Results:

Value in each accessed element of the series.

 

 


Edit Time: 4/6/2017 02:16:46 PM


Topic ID#: 359

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software