On Mon, 2003-09-29 at 04:28, venkatesh wrote: > I have to display a paragraph in the palm using windrawchars funtion. > > The length of the paragraph goes over the palm screen. > I want to divide the paragraph to number of lines with a length of 32. > wat should i need to do, to split the paragraph to number of lines. > > And also i try to use StrNCopy to copy number 'n' bytes to string...but it > adds some extra characters to the string.
This one is easy...you're not copying the terminating '\0' as the last character, so you're seeing whatever memory is after the end of the string. This is a likely crash just waiting to happen. The display of text over the length of a paragraph is tougher. I can think of a few ways, in order of easiness: 1) Figure out how the help could be put into a pop-up window, and then enter all the text into a resource, and then use FrmHelp(rsrcid). This only works if you know what your text will look like beforehand. 2) Create both a textfield and a scrollbar on your form, write the string to the textfield, updating the scrollbar as needed. This allows for dynamic text. 3) Draw it all by hand using WinDrawChars. This would likely be quite a pain (I've never bothered because the other methods listed above make this approach pointless). -Ken -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
