Commas in strings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frankleggett
    New Member
    • Oct 2006
    • 22

    #1

    Commas in strings

    Hi

    I am trying to program a simple program in Visual Basic which saves various lines of text into simple text files, then another program loads these text files as strings and outputs them to the screen. My problem is I cannot output a string completely if the text file contains a comma. For example (John Smith, Engineer) will only display as "John Smith" with ", Enginner" being ignored. Can some on give me an idea of how to get round this as all I want is the string to contain exactly what is in the text file.

    Frank Leggett
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by frankleggett
    Hi

    I am trying to program a simple program in Visual Basic which saves various lines of text into simple text files, then another program loads these text files as strings and outputs them to the screen. My problem is I cannot output a string completely if the text file contains a comma. For example (John Smith, Engineer) will only display as "John Smith" with ", Enginner" being ignored. Can some on give me an idea of how to get round this as all I want is the string to contain exactly what is in the text file.

    Frank Leggett
    Hi Frank
    Best thing would be to post the code you are using. That will get the fastest and best response
    Thanks

    Comment

    • albertw
      Contributor
      • Oct 2006
      • 267

      #3
      Originally posted by frankleggett
      Hi

      I am trying to program a simple program in Visual Basic which saves various lines of text into simple text files, then another program loads these text files as strings and outputs them to the screen. My problem is I cannot output a string completely if the text file contains a comma. For example (John Smith, Engineer) will only display as "John Smith" with ", Enginner" being ignored. Can some on give me an idea of how to get round this as all I want is the string to contain exactly what is in the text file.

      Frank Leggett
      hi

      try reading your file with

      Line Input #......instead of Input #....

      Comment

      • frankleggett
        New Member
        • Oct 2006
        • 22

        #4
        Thanks alot, Line Input works fine.

        Frank

        Comment

        Working...