By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,988 Members | 1,476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,988 IT Pros & Developers. It's quick & easy.

Commas in strings

P: 22
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
Nov 16 '06 #1
Share this Question
Share on Google+
3 Replies


100+
P: 1,646
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
Nov 16 '06 #2

100+
P: 267
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 #....
Nov 16 '06 #3

P: 22
Thanks alot, Line Input works fine.

Frank
Nov 16 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.