Limit character width (memo)

Palemo

New member
Local time
Today, 18:39
Joined
Feb 28, 2003
Messages
8
Hi,

I need to limit a memo field to 35 characters per line. That is it needs to rap after 35 characters onto the next line.

Once the user has finished typing in text, I then need something to count the number of lines.

Can anyone help me with this?

Many thanks.
 
It's probably easier to do the processing after the user has finished typing stuff in (which you will know how?). Then you could use Split function to do something like this:

Split the memo field by spaces to get each word

Split each word by a period, comma, semi-colon, etc to separate words that have punctuation but are not separated by a space

Loop through the words and add them together until the addition of the next word is greater than 35. Store that line to a new variable and keep track of the number of lines created. Once you have finished replace the text entered by the user with your newly create memo and you will also have the number of lines.

I know you were probably looking for the whole thing coded out for you but give it a try and let me know if you run into problems.
 

Users who are viewing this thread

Back
Top Bottom