Micro Focus QTP (UFT) Forums
[UFT] Get Item of ListBox and convert it to array - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: [UFT] Get Item of ListBox and convert it to array (/Thread-UFT-Get-Item-of-ListBox-and-convert-it-to-array)



[UFT] Get Item of ListBox and convert it to array - felino - 11-25-2015

Hi,
I have this code:
Code:
listDataItems = SwfWindow("myApp").SwfList("listBoxExt1").GetContent()
                
listDataItemsReplace = replace(listDataItems22, vbCrLf, ",")
dataItemArray = Split(listDataItemsReplace , ",")

I would replace new line char in listDataItems with comma char.

Why my code not work?

I've tried with vbCrLf, vbNewLine, but nothing.

Help?

Thanks.


RE: [UFT] Get Item of ListBox and convert it to array - felino - 11-26-2015

Hi,

I would check on single item of list.

I resolved with this code


Code:
For i = 0 To SwfWindow("MicAnalytics").SwfList("listBoxExt1").GetItemsCount()

     If my_condition Then
           'todo
    End If

Next

Thanks a lot!