STD
Class emos_std_misc_lib


public class emos_std_misc_lib

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

PUBLIC CONSTANTS:

Stereotype compiled module

Method Summary
 intdebug_msg(in msg)
          In debug-mode produces a "report_msg" formated as "DEBUG: msg".
 intdebug_msg2(in msg)
          In debug-mode produces a "report_msg" formated as "DEBUG: msg" if debug level >= 2.
 intfail(in rc)
          returns !0 if rc != E_OK
 intgetLastRc()
          what was the last error
 intis_debug()
          Returns the debug mode.
 intJa(in str)
          Converts a string "Y"/"Yes" or German equivalent "J"/"Ja" (case-insensitive!) to boolean.
 intload_GUI(in gui)
          Wrapper around GUI_load().
 intpass(in rc)
          returns !0 if rc == E_OK
 intrestore_timeout()
          Restores the timeout that has been overriden by the last invocation of the set_timeout() function.
 intset_debug(in mode)
          Turns debug mode on/off.
 intset_timeout(in time)
          Wrapper around setvar("timeout").
 intyes(in str)
          Converts a string "Y"/"Yes" or German equivalent "J"/"Ja" (case-insensitive!) to boolean.

Method Detail

debug_msg

public int 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 int 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

fail

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

getLastRc

public int getLastRc()
what was the last error

is_debug

public int is_debug()
Returns the debug mode.
Returns: TRUE = debug mode on FALSE = debug mode off

Ja

public int 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

load_GUI

public int 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()

pass

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

restore_timeout

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

set_debug

public int set_debug(in mode)
Turns debug mode on/off.
Parameters:
mode - (in) TRUE = turn debug on, else turn debug off

set_timeout

public int 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

yes

public int 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