Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need a logic in array - QTP
#1
Not Solved
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
Not Solved
Tagging myself in for a similar query.
Reply
#3
Not Solved
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
Not Solved
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
Not Solved
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 2,776 03-24-2014, 12:56 AM
Last Post: supputuri
  How to convert a single dimension array to two dimensional array venkatesh9032 3 5,516 02-10-2014, 03:07 PM
Last Post: pranikgarg
  Adding array to another Global array in VB Script test911 1 3,165 12-02-2012, 12:40 PM
Last Post: parminderdhiman84
  Logic to add numbers in caliculator using descriptive programming, srinivassure 1 3,103 02-08-2011, 03:33 AM
Last Post: Ankur
  Re: Iteration Code Logic Help needed sratna 3 3,639 11-09-2009, 07:08 AM
Last Post: venkatbatchu

Forum Jump:


Users browsing this thread: 2 Guest(s)