FRM
v1.4.2

ddt
Script emos_ddt_access_range_lib

CompiledModule
  |
  +--emos_ddt_access_range_lib

This library defines an "iterator" (as much as one can emulate a real iterator in a language such as TSL) for data tables (ddt-interface). The main benefits of this iterator are: 1.) you can loop through any table in an uniform way, 2.) you can choose one of four algorithms to iterate through the range: * sequntial (forward) * sequential (reverse) * random (values may get repeated) * random (values will not be repeated) 3.) you can simultaneously have iterators for multiple data tables (ane at a time per table!) 4.) you can use it to iterate any range of numbers (unrelated to data tables).

NOTE!

PUBLIC CONSTANTS:

Tsl
emos_ddt_access_range_lib.tsl

Function Summary
 String DDT_ACCESS_clean_range(in table)
          Removes range-access for given table and frees the internal buffers.
 String DDT_ACCESS_get_next_in_range(in table)
          Returns the index of the next test to be processed.
 String DDT_ACCESS_has_more_in_range(in table)
          Indicates whether there subsequent call to DDT_get_next_in_range() is about to succeed.
 String DDT_ACCESS_init_range(in table, in from, in to, in mode)
          Initialises the range-access algorithm.
protected  String delete_dimension(inout[] arr, in dim)
          This function will delete a dimension from a multidimensional array.
protected  String delete_index_array(in table)
           
protected  String get_norepeat_random_pos(in table)
           
protected  String get_random_pos(in table)
           
protected  String init_index_array(in table)
           
protected  String set_pos_used(in table, in pos)
           
 

Function Detail

DDT_ACCESS_init_range

public String DDT_ACCESS_init_range(in table,
                                    in from,
                                    in to,
                                    in mode)
Initialises the range-access algorithm.

Parameters:
table - (in) the name od the iterator (data table)
from - (in) begining of range
to - (in) end of range
mode - (in) one of four possible access modes [default: DDT_ACCESS_SEQUENTIAL]
Returns:
E_OK: initialisation succeeded !E_OK: initialisation failed

DDT_ACCESS_clean_range

public String DDT_ACCESS_clean_range(in table)
Removes range-access for given table and frees the internal buffers.

Parameters:
table - (in) the name od the iterator (data table)

DDT_ACCESS_has_more_in_range

public String DDT_ACCESS_has_more_in_range(in table)
Indicates whether there subsequent call to DDT_get_next_in_range() is about to succeed.

Parameters:
table - (in) the name od the iterator (data table)
Returns:
TRUE: there is still something left to be processed FALSE: all tests processed

DDT_ACCESS_get_next_in_range

public String DDT_ACCESS_get_next_in_range(in table)
Returns the index of the next test to be processed.

Parameters:
table - (in) the name od the iterator (data table)
Returns:
>0: test number <0: error ocurred

delete_index_array

protected String delete_index_array(in table)

init_index_array

protected String init_index_array(in table)

set_pos_used

protected String set_pos_used(in table,
                              in pos)

get_random_pos

protected String get_random_pos(in table)

get_norepeat_random_pos

protected String get_norepeat_random_pos(in table)

delete_dimension

protected String delete_dimension(inout[] arr,
                                  in dim)
This function will delete a dimension from a multidimensional array.

WARNING! It will delete ALL dimensions with the same name. For example assume your three-dimensional array "arr" has the following content:

		arr["x",1,"x"] = "x1x";
		arr["x",1,"y"] = "x1y";
		arr["y",1,"x"] = "y1x";
		arr["y",1,"y"] = "y1Y";
then the following command
		delete_dimension( arr, "x" );
will delete everything BUT
		arr["y",1,"y"] = "y1Y";

Parameters:
arr - (inout) array to be processed
dim - (in) dimension(s) to be removed

FRM
v1.4.2