Title: working with Textedit-Fields Post by: Stefan S. on February 19, 2009, 09:54:25 am Hello,
to write free text in "old"-4JS BDL we used an input array with f.e. 60 Characters per line. Each row in the array we stored as 1 row in a table. In many Reports we printed each row of this table with 60 Characters. No I want to use the textedit field instead of an Array. I definded a string-variable and read the text from the table and append it to the string. After each row I added an ascii 10 to have the same Text-Layout as before in the array. The per file is using a fixed Fontpitch, so I can only use 60 Characters per Line. That works very fine. But now I wrtie a new text. At the end of the line a new word is beginning at at next line (without CR) .... When I save the Text in the table I must be able to split the text after 60 Character, but at lines with "Word-Wrap" the "Blanks" at the end of the lines where clipped. So the 60 charactrers has the Information from 2 lines of from my Screen, but 2 Lines on the screens must be to lines in the table. I hope you understand my problem. Has anyone an idea for me thanks in advance Stefan Serwe Title: Re: working with Textedit-Fields Post by: Snorri B. on February 19, 2009, 10:32:47 am Stefan,
you just need to create a routine that splits the text something like: Code
Hope this helps, -Snorri Title: Re: working with Textedit-Fields Post by: Stefan S. on February 19, 2009, 10:57:00 am Thanks Snorri,
but splitting the text after 60 characters ist not the problem I attached a hardcopy to sh my problem. In this case I need to create 2 Lines in my table. Title: Re: working with Textedit-Fields Post by: . on February 19, 2009, 11:16:12 am Stefan,
maybe the solution is in the "wrapPolicy" TextEdit style Attribute. set it to "anywhere" then GDC will wrap your text after 60 characters, then you will see in the first line "12...WORD" and in the second "WRAP" instead of "12...90" and "WORDWRAP". Code
Title: Re: working with Textedit-Fields Post by: Snorri B. on February 19, 2009, 11:20:34 am Stefan, you just need to check in your routine if the user has enetered <LF>
We actually have a routine that works: Code
split_returns null if it finished so you can use this in a loop like: Code
Title: Re: working with Textedit-Fields Post by: Stefan S. on February 19, 2009, 01:03:27 pm OK many Thanks for the tipps
Reply 3: it works fine, but if I want to copy a text from a document and paste it into the 60-Characters textedit field there is a lot of work to correct the layout of the thext. Reply 4: This is excactly what I want to do. Great. |