### Service Functions – Math / WinRunner

Posted by Albert Gareev on Apr 25, 2007
0
Math primitives In the code examples I present I often refer to routine functions. In my framework I have specialized libraries to call from. In my blog I maintain the similar structure.  Math primitives 1 (WinRunner, TSL) Absolute value (Modulus) Check if a value has a multiple Check if a value belongs to range Check if [...] ...

### Math primitives 5 (WinRunner, TSL)

Posted by Albert Gareev on Apr 23, 2007
0
Service Functions – Math / WinRunner Find and retrieve subrange, defined by RegEx public function mx_subrange_regex(inout mxTable[], inout mxRange[], in regex_from_str, in regex_to_str, in regex_col, in flExtend, in start_row, in end_row) {  auto rc, i, j, row_index;  auto col_count, row_count;  auto flFound;  col_count = mxTable[0, "sys", "colCount"];     row_count = mxTable[0, "sys", ...

### Math primitives 4 (WinRunner, TSL)

Posted by Albert Gareev on Apr 21, 2007
0
Service Functions – Math / WinRunner Add new column to a matrix public function mx_add_col_value(inout mxTable[], in col_value) {  auto rc, i;  auto col_count, row_count;    col_count = mxTable[0, "sys", "colCount"];     row_count = mxTable[0, "sys", "rowCount"];    # create new col index  col_count++;    for (i=1;i<=row_count;i++)   mxTable[i,col_count] = col_value;     mxTable[0, ...

### Math primitives 3 (WinRunner, TSL)

Posted by Albert Gareev on Apr 19, 2007
0
Service Functions – Math / WinRunner Convert matrix to text table public function mx_array_2_table(inout mxTable[], inout dtTable[], in separator, in skip_empty) {  auto col_count, row_count, i,j;  auto row, s_value;  if (skip_empty != TRUE) skip_empty = FALSE;  if (separator == "") separator = "\t";    col_count = mxTable[0, "sys", "colCount"];     row_count = mxTable[0, "sys", ...

### Math primitives 2 (WinRunner, TSL)

Posted by Albert Gareev on Apr 17, 2007
0
Service Functions – Math / WinRunner Check a value exists in array public function mx_val_exists(in value, inout dtSet[]) {  auto i;    for (i in dtSet)   if (value == dtSet[i])    return(TRUE);    return(FALSE);   } Sort one-dimensional array public function mx_sort_vector(inout mxVector[], in flAscending) {  auto i,j,c,v;  if (flAscending != FALSE) flAscending = TRUE;  c = [...] ...

### Math primitives 1 (WinRunner, TSL)

Posted by Albert Gareev on Apr 15, 2007
0
Service Functions – Math / WinRunner Absolute value (Modulus) public function mx_val_mod(in value) {  if (value < 0)   return(-1*value);  else   return(value);  } Check if a value has a multiple public function mx_val_multiple(in value1, in value2) {  auto k;  if (value2 == 0) return(TRUE);  k = value1 / value2;  return(int(k) == k); } Check if a [...] ...