|
FRM v1.4.2 |
||||||||
PREV SCRIPT NEXT SCRIPT | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | FUNCT | DETAIL: FIELD | CONSTR | FUNCT |
CompiledModule | +--emos_frm_lib
This library provides the low-level interface to data tables. You can use the function from this library as replacement to standard ddt-functions even if you don't need other nice FRM feaures.
Here we implement our own ddt-interface and add plenty of other functions which make this interface very powerful. This library maintains a set of internal buffers which hold the table data and numerous other information. One of the "side-effects" (but since WR 6.0 one of the most important features) is the ability to use the same table from more than one main test within the same chain.
The most important feature of this interface is that you may also index table rows by some unique name (very much the same as you index columns by defining their names in the first row). For this to work the table MUST contain two columns named "IDX" and "Name". To index a row you need to define some name in the Name-column and place an "x" in the IDX-column.
For example imagine a table "Tab.xls" with the following content:
IDX | Name | a | b | c | d |
---|---|---|---|---|---|
x | Block1 | 1 | 2 | 3 | 4 |
1 | 1x1 | 1x2 | 1x3 | 1x4 | |
2 | 1x1 | 2x2 | 3x3 | 4x4 | |
x | Block2 | x | y | z | |
a | ax | ay | az | ||
b | bx | by | bz | ||
c | cx | cy | cz |
FRM_get_cell( "Tab.xls", "b", "Block1", val );
to retreive "2"
in variable val
no matter what row
used to be active before.
From then on you could use
FRM_get_next( "Tab.xls", "b", val );
to retreive "1x2"
in variable val
and so on.
PUBLIC VARIABLES
Function Summary | |
protected String |
build_idx(in tid)
Builds the internal index for marked rows. |
protected String |
build_params(in tid,
in tests)
Builds the internal data structure for (loaded) parameters (columns). |
String |
FRM_close_all_except(inout[] xtabs,
in drop)
Closes all open tables except the specified ones. |
String |
FRM_close_all(in drop)
Closes all open tables. |
String |
FRM_close(in tid,
in drop)
Closes the given table and frees occupied memory. |
String |
FRM_convert_mode(in mode)
Convert the given mode from one representation to another
(string2code and code2string). |
String |
FRM_exec(in tid,
in test)
Executes the content of the next cell. |
String |
FRM_GEN_print(in tid,
in gui_obj,
in val,
in rc)
This function was used for generating test data in GEN mode. |
String |
FRM_GEN_set(in tid,
in test,
in gui_obj,
in val,
in rc)
#??? |
protected String |
FRM_GEN_skip(in tid,
in rows)
|
String |
FRM_get_block(in tid,
in idx,
out x,
out y,
out[] arr)
Returns a two-dimensional block from the table as array. |
String |
FRM_get_cell(in tid,
in test,
in idx,
out val)
Returns the content of the cell specified by the given row ( idx )
and column (test ) names.
|
String |
FRM_get_current_row(in tid,
out row)
Retrieves the active row of a data table. |
String |
FRM_get_filename(in tid)
Returns the table name of the corresponding tid or empty string ("") if tid unknown. |
String |
FRM_get_mode(in tid)
Returns the active frame mode. |
String |
FRM_get_name(in tid)
Returns the table name of the corresponding tid or empty string ("") if tid unknown. |
String |
FRM_get_next(in tid,
in test,
out val)
Returns the content of the cell from the given column ( test )
and the row following the currently active row.
|
String |
FRM_get_parameters(in tid,
out params,
out count)
Returns a list of all loaded parameters in a FRM data table. |
String |
FRM_get_row_count(in tid,
out count)
Retrieves the number of rows in a data table. |
String |
FRM_get_tid(in table)
Returns the table ID of the corresponding table or empty string ("") if table unknown. |
String |
FRM_get(in tid,
in test,
out val,
in row)
Returns the content of the cell specified by the given column name and, optionally, with the row number. |
String |
FRM_getvar(in tid,
in var,
out val)
Retrieves the value of a given FRM variable <var>. |
String |
FRM_has_next(in tid,
in test)
Indicates whether the cell in the next row contains data or not. |
String |
FRM_idx(in tid,
in idx,
out row)
Positions the focus to the row specified by its name <idx>. |
String |
FRM_init_block(in tid,
in test,
in idx,
inout mode)
Performs the initialisation for the given test block. |
String |
FRM_is_modified(in tid)
Reports whether a given table is modified or not. |
String |
FRM_is_open(in tid)
Reports whether a given table is open or not. |
String |
FRM_is_parameter(in tid,
in param)
Returns whether a parameter in a data table is valid. |
String |
FRM_is_row(in tid,
in row)
Indicates whether a given <row> exists in the given <tid>. |
String |
FRM_is_table_open(in table,
out tid)
Reports whether a given table is open or not. |
String |
FRM_load_gui(in tid,
in gui)
Loads a GUI map <gui> in scope of the specified <tid>. |
String |
FRM_load_lib(in tid,
in lib,
in p1,
in p2)
Loads a library <lib> in scope of the specified <tid>. |
String |
FRM_load_test(in tid,
in test)
Loads an individual column (test) into an already opened data table. |
String |
FRM_log_frm_info(in tid,
in test,
in val)
|
String |
FRM_log_full_call_chain(in depth_offset)
Dumps the debug info for the calling chain starting with depth_offset . |
String |
FRM_log_obj_info(in obj)
|
String |
FRM_log_short_call_chain(in level)
Dumps the debug info for the 1 level deeper in the calling chain. |
String |
FRM_next_row(in tid)
Changes the active row in a data table to the next row. |
String |
FRM_open(in table,
in tests,
out tid,
in nameSep)
Opens a data lt;table> and loads the desired <test>s (columns). |
String |
FRM_parse_val(in tid,
inout val)
Parses the given value and substitutes FRM keywords. |
String |
FRM_rc(in rc,
in func,
in tid,
in test,
in val,
in obj)
In case of <rc> ! |
String |
FRM_rc2(in rc,
in msg,
in title)
In case of <rc> ! |
String |
FRM_save(in tid)
Saves the given table. |
String |
FRM_set_mode(in tid,
in mode)
Sets the active frame mode. |
String |
FRM_set_row(in tid,
in row)
Sets the active row in a data table. |
protected String |
FRM_SET_skip(in tid,
in rows)
|
String |
FRM_set_val_by_row(in tid,
in row,
in param,
in val)
Sets a value in a specified row of the data table. |
String |
FRM_set_val(in tid,
in param,
in val)
Sets a value in the current row of the data table. |
String |
FRM_set(in tid,
in test,
in val,
in row)
Saves the given value ( val ) in the cell specified by the column
name (test ) and, optinally, the row number.
|
String |
FRM_setvar(in tid,
in var,
in val)
Allocates a new or overwrites an existing variable <var> with the initial value <val>. |
String |
FRM_skip(in tid,
in rows)
Skips the given number of rows. |
String |
FRM_val_by_row(in tid,
in row,
in param)
Returns the value of a parameter in the specified row in a data table. |
String |
FRM_val(in tid,
in param)
Returns the value of a parameter in the active row in a data table. |
protected String |
load_column(in tid,
in par,
in rows)
Loads a given FRM-column from a data table. |
protected String |
save_column(in tid,
in par,
in rows)
Saves the FRM-column back to data table. |
Function Detail |
public String FRM_open(in table, in tests, out tid, in nameSep)
NOTE
This routine returns the tid
(table ID). Unlike the ddt_
you have to use this id when calling other FRM functions.
table
- (in) name of the data tabletests
- (in) list of columns (comma-separated)tid
- (out) table ID
public String FRM_load_test(in tid, in test)
tid
- (in) table IDtest
- (in) column name to be loaded
public String FRM_save(in tid)
NOTE! This funtion only works with WR 6.0 or higher.
tid
- (in) table ID
public String FRM_close(in tid, in drop)
NOTE! If table was modified, it is automatically saved before closing.
tid
- (in) table IDdrop
- (in) (optional) TRUE: do not save changes (default: FALSE)public String FRM_close_all(in drop)
drop
- (in) (optional) TRUE: do not save changes (default: FALSE)public String FRM_close_all_except(inout[] xtabs, in drop)
drop
- (in) (optional) TRUE: do not save changes (default: FALSE)public String FRM_is_table_open(in table, out tid)
table
- (in) table name
public String FRM_is_open(in tid)
tid
- (in) table ID
public String FRM_get_tid(in table)
table
- (in) table name
public String FRM_get_name(in tid)
tid
- (in) table ID
public String FRM_get_filename(in tid)
tid
- (in) table ID
public String FRM_is_modified(in tid)
tid
- (in) table ID
public String FRM_idx(in tid, in idx, out row)
NOTE! The row must be indexed.
tid
- (in) table IDidx
- (in) row name/indexrow
- (out) row number
public String FRM_load_lib(in tid, in lib, in p1, in p2)
NOTE! If table is closed, all libraries in its scope are automatically unloaded.
tid
- (in) table IDlib
- (in) library name (full path)p1
- (in) (optional) first parameter to underlying reload statementp2
- (in) (optional) second parameter to underlying reload statement
public String FRM_load_gui(in tid, in gui)
NOTE! If table is closed, all GUI maps in its scope are automatically unloaded.
tid
- (in) table IDgui
- (in) GUI map name (full path)
public String FRM_setvar(in tid, in var, in val)
NOTE! If it equals to "" the scope of the variable is is Frame-global. Otherwise the variable has table-scope. If table is closed, all variables in its scope are automatically unloaded. Global varables are unloaded only with FRM_close_all().
tid
- (in) table ID (scope) or "" for global variablesvar
- (in) variable nameval
- (in) value to be saved
public String FRM_getvar(in tid, in var, out val)
NOTE! If it equals to "" the scope of the variable is is Frame-global. Otherwise the variable has table-scope. If table is closed, all variables in its scope are automatically unloaded. Global varables are unloaded only with FRM_close_all().
tid
- (in) table ID (scope) or "" for global variablesvar
- (in) variable nameval
- (out) value retrieved
public String FRM_get_mode(in tid)
tid
- (in) table ID
public String FRM_set_mode(in tid, in mode)
tid
- (in) table IDmode
- (in) either FRM_SET_MODE, FRM_CHK_MODE, FRM_ATR_MODE or FRM_GEN_MODE
public String FRM_convert_mode(in mode)
mode
from one representation to another
(string2code and code2string). If none of the conversion succeeds, the
the unchanged value is returned.
mode
- (in) mode to be converted (either format)
public String FRM_has_next(in tid, in test)
tid
- (in) table IDtest
- (in) test (column) name
public String FRM_get_next(in tid, in test, out val)
test
)
and the row following the currently active row.
A cell which is supposed to be ignored (an empy cell, a cell that contains no data), is indicated with E_FRM_SKIP. If an empty string ("") needs to be used as test data, then the cell must contain one of the following two strings <<cler>> or <<leer>> (including angle brackets).
NOTE! This routine modifies the currently active row. It does this before fetching the value. If an attemp is made to fatch the value beyond the last row, E_OUT_OF_RANGE is returned.
tid
- (in) table IDtest
- (in) test (column) nameval
- (out) the fetched value
public String FRM_get_cell(in tid, in test, in idx, out val)
idx
)
and column (test
) names.
A cell which is supposed to be ignored (an empy cell, a cell that contains no data), is indicated with E_FRM_SKIP. If an empty string ("") needs to be used as test data, then the cell must contain one of the following two strings <<cler>> or <<leer>> (including angle brackets).
NOTE! For this to work the <idx> must be the content of some row in FRM_COL_NAME marked with "x" in FRM_COL_IDX.
tid
- (in) table IDtest
- (in) test (column) nameidx
- (in) row name (index)val
- (out) the fetched value
public String FRM_get(in tid, in test, out val, in row)
A cell which is supposed to be ignored (an empy cell, a cell that contains no data), is indicated with E_FRM_SKIP. If an empty string ("") needs to be used as test data, then the cell must contain one of the following two strings <<cler>> or <<leer>> (including angle brackets).
NOTE!
If row
is not defined, the current row is used.
tid
- (in) table IDtest
- (in) test (column) nameval
- (out) the fetched valuerow
- (in) (optional) row number (default: current row)
public String FRM_parse_val(in tid, inout val)
tid
- (in) table IDval
- (inout) value to be parsed; eventually modifiedd by parsing
public String FRM_set(in tid, in test, in val, in row)
val
) in the cell specified by the column
name (test
) and, optinally, the row
number.
NOTE! The change is not made permanent yet. You must call FRM_save() in order to transfer your changes back to the Excel table.
tid
- (in) table IDtest
- (in) test name (column)val
- (in) value to be savedrow
- (in) (optional) row number (default: current row)
public String FRM_get_block(in tid, in idx, out x, out y, out[] arr)
To define a block in the test table you must format it in a special way. An example of one such table follows.
IDX | Name | a | b | c | d |
---|---|---|---|---|---|
x | Block1 | 1 | 2 | 3 | 4 |
1 | 1x1 | 1x2 | 1x3 | 1x4 | |
2 | 1x1 | 2x2 | 3x3 | 4x4 | |
<<END>> | |||||
x | Block2 | x | y | z | |
a | ax | ay | az | ||
b | bx | by | bz | ||
c | cx | cy | cz | ||
<<END>> |
tid
- (in) table IDidx
- (in) block indexx
- (out) nomber of columnsy
- (out) number of rows
public String FRM_exec(in tid, in test)
tid
- (in) table IDpublic String FRM_skip(in tid, in rows)
NOTE!
If rows
is not given, one row is skipped. Therefore
FRM_skip( tab );
is equivalent to FRM_skip( tab, 1 );
.
FRM_skip( tab, 0 );
also skips to next row because 0 is taken as
the equivalent for "not given".
If rows
is negative, the function skips backwards. Therefore
FRM_skip( tab, -3 );
jumps for example from row 15 to row 12.
tid
- (in) table IDrows
- (in) (optional) number of rows to skip, negative skips backwards
protected String FRM_SET_skip(in tid, in rows)
protected String FRM_GEN_skip(in tid, in rows)
public String FRM_init_block(in tid, in test, in idx, inout mode)
NOTE
Important change since version 6.02.01.00: mode sent as parameter to
this function takes presedence over the mode of the test block header.
tid
- (in) table IDtest
- (in) column nameidx
- (in) block name (row index)mode
- (in) (optional) frame mode (default: FRM_SET_MODE)
public String FRM_rc(in rc, in func, in tid, in test, in val, in obj)
tl_step
-message
from the given parameters. It automatically determines the current row number
in the data table.
rc
- (in) return code to be evaluatedobj
- (in) logical name of the affected GUI-objecttid
- (in) tid of the affected data tabletest
- (in) name of the test case from <tid>val
- (in) content of the affected cell from <tid>
public String FRM_rc2(in rc, in msg, in title)
tl_step
-message
from the given parameters. It automatically determines the current row number
in the data table.
rc
- (in) return code to be evaluatedmsg
- (in) message contenttitle
- (in) [optional] message title (default: "MSG")
rc
public String FRM_log_frm_info(in tid, in test, in val)
public String FRM_log_obj_info(in obj)
public String FRM_log_short_call_chain(in level)
public String FRM_log_full_call_chain(in depth_offset)
depth_offset
.
depth_offset
- (in) depth of the call chain to be dumped (0 = full chain, 1 = from the caller on, etc.)public String FRM_GEN_print(in tid, in gui_obj, in val, in rc)
NOTE! Since implementing the save capability for FRM-tables (effectively modifying test date in place) this function is not used any more.
tid
- (in) table IDgui_obj
- (in) name of the affected GUI objectrc
- (in) return code received by retreiving the test date (if not
E_OK, then a special message is formatted instead of the test data).public String FRM_GEN_set(in tid, in test, in gui_obj, in val, in rc)
public String FRM_is_row(in tid, in row)
tid
- (in) table IDrow
- (in) row number to be evaluated
public String FRM_is_parameter(in tid, in param)
tid
- (in) table IDparam
- (in) The parameter name to check in the data table.
public String FRM_get_parameters(in tid, out params, out count)
NOTE!
Does NOT return columns IDX
and name
because they
are always there. For this reason the number returned is the number of all
(loaded) parameters minus 2.
tid
- (in) table IDparams
- (out) column titles (tab-separated)count
- (out) nomber of loaded columns (excluding IDX and Name)
params
and count
provided
!E_OK: faliure; params
and count
not providedpublic String FRM_get_current_row(in tid, out row)
tid
- (in) table IDrow
- (out) number of the active row (starting with 1)
public String FRM_get_row_count(in tid, out count)
tid
- (in) table IDcount
- (out) number of rows in the data table
public String FRM_set_row(in tid, in row)
tid
- (in) table IDrow
- (in) row to be set
public String FRM_next_row(in tid)
tid
- (in) table ID
public String FRM_val(in tid, in param)
tid
- (in) table IDparam
- (in) column name
public String FRM_set_val(in tid, in param, in val)
tid
- (in) table IDval
- (in) value to be setparam
- (in) column name
val
set
E_NOT_PARAMETER: failure; invalid parameter (column) name
else: other errorpublic String FRM_val_by_row(in tid, in row, in param)
tid
- (in) table IDrow
- (in) row numberparam
- (in) column name
public String FRM_set_val_by_row(in tid, in row, in param, in val)
tid
- (in) table IDrow
- (in) row numberparam
- (in) column nameval
- (in) the value to be set
val
set
E_NOT_PARAMETER: failure; invalid parameter (column) name
else: other errorprotected String build_params(in tid, in tests)
tid
- (in) table IDtests
- (in) list of tests (columns/parameters) to be loaded
protected String build_idx(in tid)
tid
- (in) table ID
protected String load_column(in tid, in par, in rows)
tid
- (in) table IDpar
- (in) column namerows
- (in) number of rows in a table (performance)
protected String save_column(in tid, in par, in rows)
tid
- (in) table IDpar
- (in) column namerows
- (in) number of rows in a table (performance)
|
FRM v1.4.2 |
||||||||
PREV SCRIPT NEXT SCRIPT | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | FUNCT | DETAIL: FIELD | CONSTR | FUNCT |