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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

returning linefeed characters 1

Status
Not open for further replies.

rachelalfonso

Programmer
Dec 6, 2000
9
PH
i am using readfile to read a binary file containing data that has been read from a com port. readfile is able to return all the contents of the file except for newline characters (linefeeds/0A/10). I need to read all the characters in the file including the linefeeds but readfile doesn't return any of the linefeed characters.

help.help.help.

rachel
 
What function are you using to read from the Serial Port? That is a big problem, you may want to try something like the following:

Code:
byte = get_symbol();
while (byte != EOF)
     byte = get_symbol();

I am not particularly farmilar with binary read / writes but get_symbol() would be an arbitrary routine that reads in a single byte ignoring the bytes context.
 
10Q, mjc.
taking your suggestion,i caused readfile to read from the port handle one byte at a time. After reading a single byte, I placed a temporary condition for displaying a message if the character just read is equal to 13 or 10. if it was 13, the message would say "carriage return" or if it was 10, "linefeed".

I only get "carriage return" messages and no linefeeds though i have already read the handle one byte at a time.

i'd appreciate ANY suggestion.

 
i got it.

My application doesn't have a problem at all.
It IS the hyperterminal which does NOT send linefeed characters in the first place.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top