FRM
v1.4.2

std
Script emos_std_misc_lib

CompiledModule
  |
  +--emos_std_misc_lib

Contains some general-purpose miscellaneous function that do not seem to fit nicely into any other EMOS library.

PUBLIC CONSTANTS:

Tsl
emos_std_misc_lib.tsl

Function Summary
protected  String addPath(in path)
           
 String create_file(in dir, in name)
          Creates a new file.
 String debug_msg(in msg)
          In debug-mode produces a "report_msg" formated as "DEBUG: msg".
 String debug_msg2(in msg)
          In debug-mode produces a "report_msg" formated as "DEBUG: msg" if debug level >= 2.
protected  String extractPath(in searchPath)
           
 String fail(in rc)
          returns !
protected  String get_arrsep()
          WR has a nice bug with in-operator operating on multi-dimensional arrays.
 String get_log_call_level()
          Returns the level for logging call chains.
 String getLastRc()
          what was the last error
 String is_debug()
          Returns the debug mode.
 String isCompiledModule(in test)
          Returns true if the given test name refers to a compiled module otherwise false is returned.
 String Ja(in str)
          Converts a string "Y"/"Yes" or German equivalent "J"/"Ja" (case-insensitive!)
 String load_GUI(in gui)
          Wrapper around GUI_load().
 String pass(in rc)
          returns !
 String restore_timeout()
          Restores the timeout that has been overriden by the last invocation of the set_timeout() function.
 String set_debug(in mode)
          Turns debug mode on/off.
 String set_log_call_level(in level)
          Defines the level for logging call chains.
 String set_timeout(in time)
          Wrapper around setvar("timeout").
 String splitSearchPath(out[] outArr)
          Returns true if specified test refers to a WinRunner compiled module
 String yes(in str)
          Converts a string "Y"/"Yes" or German equivalent "J"/"Ja" (case-insensitive!)
 

Function Detail

set_debug

public String set_debug(in mode)
Turns debug mode on/off.

Parameters:
mode - (in) TRUE = turn debug on, else turn debug off

is_debug

public String is_debug()
Returns the debug mode.

Returns:
TRUE = debug mode on FALSE = debug mode off

debug_msg

public String debug_msg(in msg)
In debug-mode produces a "report_msg" formated as "DEBUG: msg". Otherwise just returns (no message produced).

Parameters:
msg - (in) message to be reported in debug mode

debug_msg2

public String debug_msg2(in msg)
In debug-mode produces a "report_msg" formated as "DEBUG: msg" if debug level >= 2. Otherwise just returns (no message produced).

Parameters:
msg - (in) message to be reported in debug mode

set_log_call_level

public String set_log_call_level(in level)
Defines the level for logging call chains.

Parameters:
level - (in) 0 = no call logging; 1 = log only full chains (in case of error); 2 = log full chains and short chains (in case of E_OK)

get_log_call_level

public String get_log_call_level()
Returns the level for logging call chains.


load_GUI

public String load_GUI(in gui)
Wrapper around GUI_load(). It makes sure that the gui is unloaded first before the load is attempted (avoids a message). Additionally it produces a tl_step() message documenting the outcome of invoked GUI_load() function.

Parameters:
gui - (in) filename/path of a GUI-map to be loaded
Returns:
E_OK: operation successfull otherwise: see return values for GUI_load()

yes

public String yes(in str)
Converts a string "Y"/"Yes" or German equivalent "J"/"Ja" (case-insensitive!) to boolean. This function is particularly useful when reading user input (either interactivelly or from data-tables).

NOTE! Blanks are trimmed from both sides of before comparison.

Parameters:
str - (in) string to be evaluated
Returns:
TRUE: string resambles to "y","yes","j" or "ja" FALSE: string resambles to anything else

Ja

public String Ja(in str)
Converts a string "Y"/"Yes" or German equivalent "J"/"Ja" (case-insensitive!) to boolean. This function is particularly useful when reading user input (either interactivelly or from data-tables).

NOTE! Blanks are trimmed from both sides of before comparison.

Parameters:
str - (in) string to be evaluated
Returns:
TRUE: string resambles to "y","yes","j" or "ja" FALSE: string resambles to anything else

set_timeout

public String set_timeout(in time)
Wrapper around setvar("timeout"). It saves the current timeout before setting it to the new value.

Parameters:
time - (in) timeout (in seconds) to be set

restore_timeout

public String restore_timeout()
Restores the timeout that has been overriden by the last invocation of the set_timeout() function.


get_arrsep

protected String get_arrsep()
WR has a nice bug with in-operator operating on multi-dimensional arrays. For example for ( i in arr ) returns different occasionally returns different separators (mostly pipe | but simetimes something else that appears as bold pipe) With this function we determine the separator dynamically as it seems to stay constant during the single WR invocation.


pass

public String pass(in rc)
returns !0 if rc == E_OK


fail

public String fail(in rc)
returns !0 if rc != E_OK


getLastRc

public String getLastRc()
what was the last error


addPath

protected String addPath(in path)

extractPath

protected String extractPath(in searchPath)

splitSearchPath

public String splitSearchPath(out[] outArr)
Returns true if specified test refers to a WinRunner compiled module

Returns:
true if test is the compiled module otherwise false

isCompiledModule

public String isCompiledModule(in test)
Returns true if the given test name refers to a compiled module otherwise false is returned. Search path is taken into account.

Parameters:
test - (in) name of the test
Returns:
true if the given test name refers to a compiled module otherwise false

create_file

public String create_file(in dir,
                          in name)
Creates a new file.

Parameters:
dir - directory name or full path name (second parameter must be empty)
name - filename (if empty, fullpath assumed in first parameter)
Returns:
E_OK success, else failire

FRM
v1.4.2