Vscroll Property of a field that is scrolled to the end

Peter Brigham pmbrig at gmail.com
Wed Jul 9 18:45:30 EDT 2008


On Jul 7, 2008, at 10:49 AM, Scott Rossi <scott at tactilemedia.com> wrote:

> Recently, Sivakatirswami wrote:
>
>> How do you get the vscroll of a field that would be scrolled all  
>> the way
>> to the end, without actually scrolling it to the end?
>
> The formattedHeight of the field - the height of the field - the  
> margins of
> the field comes very close.  But for an exact number, I usually  
> lock the
> screen, set the vscroll to a huge amount (100000000), get the  
> scroll of the
> fld, reset the vscroll to its original value, and then unlock the  
> screen.  A
> bit goofy but it's fast and it works.
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, Multimedia & Design

I discovered another way a while ago:

function maxScroll fldName
   put the scroll of fld fldName into iScr
   lock screen
   select after text of fld fldName
   put the scroll of fld fldName into maxScr
   select empty
   set the scroll of fld fldName to iScr
   unlock screen
   return maxScr
end mouseUp

You'll have to adjust the field reference if the field is not on the  
current card.

Peter M. Brigham
pmbrig at gmail.com



More information about the use-livecode mailing list