StrChr is an instruction which allow you to search a character within a string.
So, in the example you gave, StrChr ( msg, '\n' ), will return the address where the character '\n' can be found in msg. If you want to add '\n' in msg you should use StrCat. ==>> StrCat ( msg, "\n" ); // becareful the second argument is a string Cordialement, Agus Silas BST Technologies T. (+33) 5 57 80 16 03 F. (+33) 5 57 77 29 97 http://www.bst-technologies.com ******************************************** ******************************************** -----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De la part de Richard Coutts Envoy� : mardi 10 septembre 2002 05:42 � : Palm Developer Forum Objet : Re: newline in string resource > I have a string resource that I would like to add some simple formatting to > with newlines. Is this possible? I'm using "\n" but am getting errors. Not sure if this will help you at all, but here's a function I coded recently (I took out some superfluous stuff, so test it if you use it). // // Equivalent of "WinDrawChars" but handles newlines (lifted from PalmOS.com) // void cfDrawChars(Char* msg, short xp, short yp) { Char* c; UInt16 msgLen; while (msg) { c = StrChr(msg, '\n'); if (c == NULL) msgLen = StrLen(msg); else { msgLen = c-msg; c++; } WinPaintChars(msg, msgLen, xp, yp); yp += FntLineHeight(); msg = c; } } -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
