determining if cursor is in last line of a field

Peter M. Brigham pmbrig at gmail.com
Wed Sep 18 11:34:54 EDT 2013


On Sep 18, 2013, at 9:22 AM, Dr. Hawkins wrote:

> If selectedLine() is 1, I am in the first line of a field.
> 
> I can't tell, though, what the last line is--"the number of lines" relies
> on CR, not how the field is actually formatted.
> 
> I've looked for other "line" entries in the dictionary, but without any
> luck.

Not sure what you mean, "how the field is actually formatted." If you are talking about possibly having empty lines following the last text in the field, then
   the number of lines of (word 1 to -1 of fld "myField")
would work. Compare this value with
   the number of lines of char 1 to (word 4 of the selectedchunk) of fld "myField"

Maybe I don't understand the problem, though.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list