Re: Using control characters in xcode
Re: Using control characters in xcode
- Subject: Re: Using control characters in xcode
- From: Alex Raftis <email@hidden>
- Date: Fri, 28 May 2004 10:12:58 -0500
On May 27, 2004, at 1:46 PM, Robinson, Josh D wrote:
I am currently writing an implementation of ASTM serial
communication. The problem is that it relies a great deal on Line Feed
characters and Carriage Return Characters. When ever I try to put
these into xcode to use in a string comparison I create a new line.
Does anyone know how I might be able to get around this?
Are you using the proper escapes? For example '\n' for newline and '\r'
for carriage return. You can also use '\x00' or '\000' to pass in
hexadecimal or octal values in your strings. Thus, "\n\x0a\012" would
produce a string with three newlines. Note that if you try to put
control characters directly into your code, you're subject to the
string encoding used by the compiler, which will cause things like the
carriage returns and line feeds to be interpreted differently on
different computers. Escape sequences are always translated literally.
Alex Raftis
---
email@hidden
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.