Word wrapping on fill-in boxes

jamesmc

Member
Good morning folks,

I want to create a comments screen where a user can type a long message. I thought of using an editor box but the variable I assign to the editor can only have a maximum capacity of 256 characters.

So I thought of using a variable with a format of, say, 50 characters and an extent of 15. When I do this a user can type away on the first line and when they reach the last space I can get the cursor to auto-return but if they reach the end of the comment line half way through a word I can't get the whole word to wrap onto the next line!

Any help available??

I have attached the code that I am using.

TIA

James.

<font color=red>
define variable w-comments as cha format "x(50)" extent 15.

define frame a
w-comments at row 4 col 1 auto-return no-label
WITH KEEP-TAB-ORDER OVERLAY THREE-D side-labels.

update w-comments with frame a.
</font>
 
James,

Use the TEXT function like this:

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
define variable w-comments as cha format "x(50)" extent 15.

define frame a
w-comments at row 4 col 1 auto-return no-label
WITH KEEP-TAB-ORDER OVERLAY THREE-D side-labels.

update TEXT(w-comments) with frame a.
[/code]

I have to admit though, an editor widget would look nicer on screen.

Cheers
Rich
 
Rich,

That solution works great. Thanks.

I know an editor would look better but the editor restricts a user to only 256 characters (or is there something else I don't know?) and I need a lot more space for the user to put their comments.

Thanks.

James.
 
Rich,

I haven't created an editor widget. I just declare a 256 char variable and view it as an editor. Perhaps I might look into creating the necessary widgets to maximise user input.

Thanks,

James.
 
James,

You are not limited to 256 characters with an editor widget, its about 20k, unless you set the LARGE attribute in which case its more. Even though Progress holds a format of say "x(256)" the database will store the entire contents.

Cheers
Rich
 
James,

How you create the editor is irrelevant it will work just the same.

This piece of code:
<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
DEF VAR c-editor AS CHAR FORMAT "x(256)" VIEW-AS EDITOR INNER-LINES 10 INNER-CHARS 50 LARGE.

UPDATE c-editor WITH NO-LABELS.

[/code]
gives you the same functionality as creating an editor widget. The 'FORMAT "x(256)"' is actually reduntant here, you would have to specify MAX-CHARS 256 to actually limit the default behaviour of the editor widget to accepting 256 chars.

Hope this helps,

Rich
 
Back
Top