Page 1 of 1

Scrolling Field Question

Posted: Tue Nov 04, 2008 7:16 pm
by warrenk
Is there anyway to limit the length of each line of a scrolling field. I want the data to wrap after 50 characters (even if ENTER is not selected).

How would I do this? I tried the code below and it is not working (this was a total guess of how I thought it would work...so don't laugh if I am way off the mark).

on keyDown theKey
if the length of me = 50 then
put field "Notes" & CRLF into field "Notes"
pass keyDown
else
pass keyDown
end if
end keyDown

Posted: Tue Nov 04, 2008 7:39 pm
by FourthWorld
I've a lot of reading ahead of me this morning so I haven't thought about your code too deeply, but I think there's just one too many pass statements in there.

Offhand (read, "untested" <g>) I think you should be able to get away with this:

on keyDown k
if len(me) < 50 then pass keyDown
end keyDown

Let me know if that doesn't do what you need and we'll come up with something that does.

Posted: Tue Nov 04, 2008 8:12 pm
by warrenk
Richard,

Thanks for the response. I just realized I had the don't wrap checked off on the field. When I removed this...everything worked. Stupid mistake!

Warren