Double checking maximum vertical scroll

Curry Kenworthy curry at
Mon Jul 19 18:35:37 EDT 2021


 > In a list field, if you are scrolling a field by script control,
 > the max vertical scroll to display the last line

 > essentially you have to take the formattedHeight
 > minus the field height and subtract out the margins and borders

Subtracting the topmargin is not needed (and gives the wrong value)
because you want the last line. The formattedHeight covers that.
So just subtract the bottomMargin and height if desired.

(The topmargin would be more useful to display the FIRST line.)

Additionally, LC fields don't scroll past their contents
(unless the field in question has a large bottomMargin)
so setting a scroll of 2^30 also works well in practice.
For most cases, we don't have to calculate the max; LC does.

Best wishes,

Curry Kenworthy

Custom Software Development
"Better Methods, Better Results"
LiveCode Training and Consulting

More information about the use-livecode mailing list