MEMLINES() expects the name of a memo field, how do you use that if your field is C(240)? If you copy over the editbox value into a memo field, you can apply it, but it'll return the number of lines the whole string has, not a "current" line number.
SET MEMOWIDTH help topic says it respects the font setting of _screen, quote:
VFP help said:
If output is directed to the main Visual FoxPro window, the width of the output is determined by the font for the main Visual FoxPro window. If output is directed to a user-defined window, the width of the output is determined by the font for the user-defined window.
I'm not sure what to make of that, as MEMOWIDTH still is about the number of characters.
I made a small experiment. This is what I get:
The Editbox is set up to allow exactly 60 characters of monospaces Courier New text in that font size. I copied that Editbox content to a memo field os a cursor, SET MEMOWIDTH TO 60 (before even creating the cursor).
You see I didn't change the _Screen font to Courier New, too. The output directly below the Editbox is from simply printing that memo field. The output after '---' is done with MLINE(memo,1) to MLINE(memo,5). I think the output of the memo itself with ? memo wraps differently, because of that. MLINE() seems to work 1:1 and by the way MEMLINES() returns 5, too.
From that experiment, MEMLINES seems ok, I'd perhaps rely more on MLINE reproducing the lines. Both also seem to work when you introduce manual line breaks with ENTER. Anyway, more than 4 lines fit in char(240) with manual line breaks. If you want to limit this to 4 lines, then checking MEMLINES seems ok, once you go for a monospaced font.
Bye, Olaf.
Olaf Doschke Software Engineering