locked
Case Sensitivity Problem... RRS feed

  • Question

  • Private Sub Command1_Click()
    Dim ime As Variant
    Dim sifra As Variant
    Dim FileName As String

    Text = Text2.Text

     

    Open "c:\sifra.txt" For Input As #

    Input #1, ime, sifra
            Do Until ime = Text
               

                  Input #1, ime, sifra
                
            Loop
        
          Close

    Text1.Text = sifra

    End Sub

     

    This Is my simple program that I am having a problem with. What I am trying to do is to search a text file. I want to type a text in a text box, and my program should find that word and print line where that word is.

    My problem is in case sensitivity. How can I ignore case sensitivity and when I type word in textbox, program find that word In text file no meter of case property

     

    Wednesday, April 4, 2007 6:15 PM

Answers

  • Use a temporary variable for your line:

     

    TheCurrentLine = ime.ToLower

     

    Alos you may wish to consider using the SYstem.IO namespace for you file IO instead of the legacy Input function

    Wednesday, April 4, 2007 9:44 PM

All replies

  • Put both the textbox text and the line input to the same case (ToLower) or (ToUpper)
    Wednesday, April 4, 2007 6:20 PM
  • Ok, but, I need to print some names in document, and just first letter should be upper case. How should I do that?

    Wednesday, April 4, 2007 9:21 PM
  • Use a temporary variable for your line:

     

    TheCurrentLine = ime.ToLower

     

    Alos you may wish to consider using the SYstem.IO namespace for you file IO instead of the legacy Input function

    Wednesday, April 4, 2007 9:44 PM