> Hey math wizards. I'm feeling stupid.
> I know I know how to do this, but I can't figure it out!
> Here's my problem.
> 
> I've got a slider.
> It's position on the bar is x.
> x goes from 30 to 250.
> 
> I need to return a percentage of variable
> total based on where x is on the slider.
> 
> total = someNumber
> 
> I don't need slider programming, just the math.
> 
> 30 = 1%
> 250 = 100%
> 
> x = ???
> 
> I know this is too easy. I feel dumb.
> 
> Steven
> 
> 
Hi Steven,

If your sliders postion is "currentH" and
minimumH = 30 and
maximumH = 250

theMove = currentH - minimumH
percentMoved = (theMove/float(maximumH - minimumH) ) * 100


hope it helps,

Ask

.....ULTIMATUM........
 Ask Møller - Lingo++
  [EMAIL PROTECTED]
  Tlf. 33 25 21 12
 Mobil 26 72 21 15
......................


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to