Find the scroll location in wrapped field

James Hale james at thehales.id.au
Tue Nov 18 00:18:37 EST 2014


As per the forum discussion, if you want the desired text to scroll to the top of the field you simply need to scroll first to the bottom of the field. Selecting line x of a field instructs the engine to scroll the field contents until line x is visible. As the engine stops as soon as the desired position is visible in the field, starting the field at its bottom scroll means that the sought line can only appear at the top of the field (unless of course it is already visible.) it matters not whether the text height is fixed or variable. The engine knows when a line becomes visible regardless of whatever text heights are involved.
So if you have the linenumber of the line contains the text you wish to see at the top of the field then...

   select line  -1 of  field "TextToScroll"
   select line linenumber of  field "TextToScroll" 

And line linenumber will now be at the top of the field.

James





More information about the use-livecode mailing list