Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with loading memo from text file..

Status
Not open for further replies.

BuilderSpec

Programmer
Dec 24, 2003
383
GB
Hi

Have got a text file that if i open with notepad displays some wierd characters half way through , if i load the file into a memo or tstringlist it stops at the wierd bit. Is there a flag or method i can use to make the memo/stringlist read in the entire file ?

Regards
BuilderSpec
 
you can take an exe file and convert the
extension to txt and open it , or attempt
to open it in a text editor. as you noticed
some editors attempt to translate all the
characters into their text readable form.
hence all the smileys and such. some just
stop reading the file at the first non alpha/num
character. What you have is a file that is not
necessarily a text file. you can write any of the
ascii code characters to a file and put the txt
extension on it and it is not nesessarily a txt file.
its just a file that has stuff in it and the
explanation about whether it is a text or binary
file in my opionion is irrelevant. after all
text or binary has no distinction
other than some arcane usage property. after all
the char 'a' means something in the binary format
as well as the text format. Its just that the char
is interpreted as part or parcel of some machine code
in an executable.

my suggestion is that if yu have to work with this
file you use a char array [][] to store the lines.
keeping in mind that the strings may contain other than
the alpha/num character set.

take a look at the ascii table


does this seem familiar.

sure we hav not gone into the nuts and bolts of the
sicussion of binary/text.


and even better


TC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top