Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 [RESOLVED] If selection problem

$
0
0
Hi Guys,

I never thought i would need help here it looked so simple lol

code:

Code:

            For Each itm As String In formMain.ListBoxMain.Items

                Dim arraySplit As String() = itm.Split(">"c)
                Dim url As String = Trim(arraySplit(0))
                Dim fir As String = Trim(arraySplit(1))
                Dim sec As String = Trim(arraySplit(2))

                If (comboBoxtf.Text >= sec) Then

                    Using SWR As New StreamWriter(SaveFileDialog1.FileName, True)

                        If (chkBoxSaveTrust.Checked = True) Then
                            SWR.WriteLine(url & "|" & sec)
                        Else
                            SWR.WriteLine(url)
                        End If

                    End Using

                End If

            Next

What happens is a url in the listbox gets assigned a number from [1-40], the array here: Dim sec As String = Trim(arraySplit(2)) contains that number [1-40] i want to export all urls (equal to or above) what the user selects, if i select 10 from the combobox we save all urls that are 10+ in to a .txt file etc, so If (comboBoxtf.Text >= sec) Then if the user selected number is >= to the number we retrieve then save it to file, but what's happening is if we select 5, then 5 urls get saved, if we select 10, then 10 urls are saved (regardless of what the sec array contains) etc

I can do it another way mind you but i would love to know why this failed lol when i print out the digits they do match! i can't figure it out lol

any help would be greta guys!

cheers

Graham

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>