Scrolling to a line in a field

David Bovill david at vaudevillecourt.tv
Sun Jan 11 19:15:52 EST 2009


I have this old command - and just found that it is not accurate for a field
of text with large line numbers. Can anyone make it more accurate?

on field_ScrollToLine lineNum, fieldObject
    -- does not seem accurate for large line numbers (it's an underestimate)
???

    if lineNum = 0 then
        put 0 into someScroll
    else if lineNum is a number then
        put the effective textheight of fieldObject into lineHeight
        put ((lineNum - 1) * lineHeight) * the height of fieldObject into
someScroll
    end if
    set the scroll of fieldObject to someScroll
end field_ScrollToLine



More information about the use-livecode mailing list