Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to use array in QTP
#1
Not Solved
Hello,

I have converted a string into an array using below function.

Function SpliteStringToArray(mystring, delimiter, outputArray)

    myArray = split(mystring, delimiter)

    For i = Lbound(myArray) to Ubound(myArray)
      outputArray = myArray(i)
    Next

End Function


But after calling the function, i am not able to use the outputArray.

Call SpliteStringToArray("amit/qtp", "/", Array1)
print Array1(1)

It gived error as type mismatch.
Please help


Regards
Amit
Reply
#2
Not Solved
Example of use:

Dim arrayList
Call SpliteStringToArray("1,2,3,4,5"",", arrayList)
For i = Lbound(arrayList) to Ubound(arrayList)
    msgbox(arrayList(i))
Next


Public Function SpliteStringToArray(mystring, delimiter, outputArray)

    myArray = split(mystring, delimiter)

    ReDim outputArray(Ubound(myArray))
    outputArray = myArray

End Function
Reply
#3
Not Solved
Hello ovidiu,

Thanks a lot.
Its working now.



Regards
Amit
Reply
Jump to the post that solved this thread.


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP/UFT - Storing Multiple Arrays In An Array Eitel13 0 1,794 07-17-2018, 04:37 PM
Last Post: Eitel13
  Unable to select an item from weblist and unable to enter text in edit box estherindu 5 9,561 05-15-2012, 12:07 AM
Last Post: viswa
  How to use Array of Array in QTP dineshb 1 16,624 12-12-2009, 02:00 AM
Last Post: rdemers25
  Array function for Static Array anbarasu 2 3,821 11-20-2009, 12:18 PM
Last Post: anbarasu
Sad How to find Array Length in QTP? bhanu_bp7 3 34,363 07-25-2008, 10:33 PM
Last Post: blavanya

Forum Jump:


Users browsing this thread: 2 Guest(s)