Forum Discussion
Hi Flossy,
Add your .vbs file as an existing item to your project. Then in your main script, use:
'USEUNIT string_functions
sub Main()
...
strDay = ChooseStr(strWeek, 3)
' or prefix the function name with the file name
strDay = string_functions.ChooseStr(strWeek, 3)
...
end sub
That said, this specific example (reading an item from a comma-separated list) can be replaced with TestComplete's built-in function aqString.GetListItem:
strWeek = "Sun,Mon,Tues,Wed,Thus,Fri,Sat"
aqString.ListSeparator = "," strDay = aqString.GetListItem(strWeek, 2) ' Indexes start from 0, so the 3rd item has index 2
Thank you for your answer which solved the initial problem.
Unfortunately our current QTP framework has more than 400 function libraries built up over the last 10 years, covering:
- Basic framework functions;
- Business functions;
- Applications functions (used by the Business functions).
Each test (250+) is controlled by an Excel spreadsheet which lists a sequence of Business functions required to cover a specific Business Process, with the test name used to identify the controlling spreadsheet.
Hopefully we will be able to use TestComplete's built-in functions to replace, or simplify, a lot the current QTP based function libraries.
I think the conversion exercise will take a little bit longer :-)