Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working with array
#1
Not Solved
i created following code to split with delimetre "," now i want to store output in an array please help how to do

Code:
Dim out, svar
svar = "1,a;2,b;3,c;4,d;5,e"
out = split(svar,",")
For each i in out
    print i
Next
Reply
#2
Not Solved
your split output itself is an array. Refer to VBScripting basics or QTP helper guide.

in the above code ''out" is an array.
Thanks,
SUpputuri
Reply
#3
Not Solved
hi supputuri thanks for reply I know this is array but i want to store all elements after "," in an array and elements after ";" in another array
Reply
#4
Not Solved
Your two arrays would be arr1 and arr2 below -

Code:
Dim svar, out, arr, arr1, arr2
svar = "1,a;2,b;3,c;4,d;5,e"
out = split(svar,";")

ReDim arr1(UBound(out))
ReDim arr2(UBound(out))

For i = 0 To UBound(out)

arr = split(out(i),",")

    arr1(i) = arr(0)
    arr2(i) = arr(1)
    
Next

@all : I'm sure there must be some better solution to this, please try and put it here.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to convert a single dimension array to two dimensional array venkatesh9032 3 5,230 02-10-2014, 03:07 PM
Last Post: pranikgarg
  Adding array to another Global array in VB Script test911 1 3,012 12-02-2012, 12:40 PM
Last Post: parminderdhiman84

Forum Jump:


Users browsing this thread: 1 Guest(s)