split number into individual digits c# script and then use for loop
Hello,
I need a script to get me on the right road. I have a variable that parses a number from an SQL query example: 128 or 258 and any other combination possible.
I need to separate those numbers and click the coordinates(can't map the buttons because of overlapping windows).
Example how it should look:
Variable SQL query returns 2589
Separated number 2 needs to click the coordinates that are set.
Separated number 5 needs to click the other coordinates that are set
and so on....
I think it is possible to do with a for loop. But I am quite new to scripting and don't know how to do it.
Or maybe is it possible to accomplish all of this through the KeywordTests ?
If my explanation is unclear do not hesitate to ask anything I will try to put all the information you need.
You can convert that number to a string
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqconvert/index.html
then pick the string apart for your coordinates
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqstring/index.html
Then convert the separate coordinates back to numbers using aqconvert again.
Try the examples and then with your numbers and let us know if you get stuck.