Scrollbar (slider) mystery.

Stephen Barncard stephenREVOLUTION at barncard.com
Sat Jun 18 01:35:51 EDT 2005


may I suggest

set the numberformat to "0"
put the thumbPos of scrollbar "Slider1" into fR
put fR && fr+1 into msg


I think we're seeing some kind of dithering when it comes to slider 
values if the numberformat is not set to represent an integer. The 
slider has a finite number of gradations possible at 72 dpi for mac 
and ?? for windows.. and they don't always line up right, hence the 
odd fraction. This is normal.  Just make sure you set the 
numberformat.

this works for me OSX3.9, Rev 2.6 build 91




At 10:13 PM -0700 6/17/05, Ken Ray wrote:
>  > Here's some simple code:
>>
>  >>   put the thumbPos of scrollbar "Slider1" into fR
>>>    put fR  into msg
>>
>>  The slider has startvalue 1, endvalue 100, and thumbPos 75  (all set in
>>  the property inspector).
>>
>>  This prints out "75" just as I expected.
>>  But  fR doesn't *really* have the value 75, as I found out after
>>  literally hours of debugging :-(
>>
>>  If I change the code to
>>
>  >>   put the thumbPos of scrollbar "Slider1" into fR
>  >>   put fR && fr+1 into msg
>  >
>>  it prints out
>>  75  75.856855
>
>Alex, I just did your example, and I got:
>
>    75  76
>
>That was just dragging out a slider, setting the values as you identified,
>and typing in the message box. I tested in 2.5.1 - what version of Rev are
>you using? And if you're using 2.6, can you try in 2.5.1 and see if you get
>a different result?
>
>Ken Ray
>Sons of Thunder Software
>Email: kray at sonsothunder.com
>Web Site: http://www.sonsothunder.com/


More information about the use-livecode mailing list