Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need a logic in array - QTP
#1
Hi Guys,

I need your help for below logic
i Have a array which stores text values of radio button to choose in my application and another array of values which has to be choosed based on first array values.consider the below examples
Array A = {1;2;3}
Array B = {x,y,z;a,b;v,f,g,h}

From the above arrays, i need to select 1 radio button and once its gets selected i need to select its associated values like x&y&z, same for 2 with a,b and 3 with v,f,g,h

could you pls help in this? can you give me the script for it..

Thanks & hoping will get soon a solution for this
Reply
#2
Tagging myself in for a similar query.
Reply
#3
Could you give some more realistic information about your problem, we can try to give best?

With the data you've given we can simply writes the code using select case statement.
Reply
#4
Please find the code.
Array A = {1;2;3}
Array B = {x,y,z;a,b;v,f,g,h}

Code:
sFirstArraySpilt = Split(A,";") sSecondArraySplit = Split(B,";") For I=0 to UBOUND(sFirstArraySpilt) sSecondArrayValues = sSecondArraySplit(I) 'Here sSecondArrayValues contains the values separated with commas ex: x,y,z for the first value in Array A Next
Reply
#5
Code:
'make sure A & B having the same number of elements Dim arrA,arrB,arrsubB Dim val arrA = Split(A,";") arrB = Split(B,";") For i = 0 to Ubound (arrA) Step 1 arrsubB = Split(arrB(i),",") For j = 0 to UBound(arrsubB) Step 1 val = arrsubB(j) 'Do with each of your value, example: x,y,z Next Next
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  VB Script logic Suma Parimal 3 3,342 03-24-2014, 12:56 AM
Last Post: supputuri
  How to convert a single dimension array to two dimensional array venkatesh9032 3 6,427 02-10-2014, 03:07 PM
Last Post: pranikgarg
  Adding array to another Global array in VB Script test911 1 3,574 12-02-2012, 12:40 PM
Last Post: parminderdhiman84
  Logic to add numbers in caliculator using descriptive programming, srinivassure 1 3,519 02-08-2011, 03:33 AM
Last Post: Ankur
  Re: Iteration Code Logic Help needed sratna 3 4,568 11-09-2009, 07:08 AM
Last Post: venkatbatchu

Forum Jump:


Users browsing this thread: 1 Guest(s)