Scrollbar (slider) mystery.

Alex Tweedly alex at tweedly.net
Fri Jun 17 21:35:43 EDT 2005


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
 (i.e.   fR really has  somewhere close to 74.866855 in it, but 
"put"ting it for some reason rounds it 75)

I assumed the value of the thumbPos would be an integer - mostly because 
the prop inspector won't let me set any other values, partly because I 
just expected it to be, and partly because that's what it appears to be 
when you examine the variable by outputting it (or by looking at it in 
the debugger).

I can deal with non-integral values - but I'm really worried that a 
value which was noticeably different from the integer was printed out as 
an integer both in the debugger and by "put ... into msg".

Am I missing something basic here ?
Why should Rev be doing this ?

P.S. the reason this took hours to find was that both  the put 
statements I added for debugging and later the debugger itself were 
giving misleading info - if either of them had said "74.85..." I'd have 
seen the problem in 30 seconds (I think).


-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.7.6/19 - Release Date: 16/06/2005



More information about the use-livecode mailing list