Hang on a second. I see you want to limit the number of characters per line. Selstart won't do that. It returns the position of the cursor relative to the start of the text, not the start of the line.
Maybe there's some way of doing it with ALINES():
- Copy the contents of the edit box to a variable.
- Use ALINES() to get it into an array.
- Use Selstart to work out which row in the array the cursor is on, and which character position within the line.
It sounds a bit fiddly to me. Maybe someone else will have a better idea.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Thanks. I tried that. It gives me the character count from the beginning of the text. I need to know the character count from the beginning of the line that the cursor is on.
*- Text from beginning to Insertion Point
lcTempString = LEFT(THIS.TEXT,THIS.SELSTART)
*- Last Carriage Return, end of previous line
lcBegOfLine = RAT(CHR(13),lcTempString)
IF THIS.SELSTART - lcBegOfLine > 70
IF FILE((ADDBS(GETENV('windir')))+'MEDIA\DING.WAV')
SET BELL TO (ADDBS(GETENV('windir')))+'MEDIA\DING.WAV'
?? CHR(7)
SET BELL TO
ENDIF
ENDIF
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.