Jason Charalambides <ja****@mail.utexas.edu> schreef in berichtnieuws
qh********************@twister.austin.rr.com...
Hello Jason,
I need to assign a slider to determine a percentage value for a certain
variable in my program. I decided to use a slider so that the user will
be able to manually set a value between 0.000... to 1.000 for that variable.
That might be a problem, 'cause the slider seems to work with a long-integer
(whole numbers only). It looks like you will have to convert yourself (Hint
: just divide the gotten value by what it can become at max.)
The problem for me is how do I associate the slider to that variable?
You can't/don't. Just like with the other controls, you just, when you need
it, request whatever you need from the control to be returned. Like as in
most cases, you can "grab" the current value from the Slider using (what
else :-) Slider1.value
Do I need to write something specific within that or do I just give the
slider control the name of the variable that it shall control?
That's another way to work with the Slider's value (the control pushing it's
value into the outside world, as opposed to the outside world grabbing it
from the control).
You can change an outside variable from within one of the Slider's events.
The two events that could be used for it are the Change and Scroll -event.
In either you could place something like :
{Outside-variable} = Slider1.value
Thank you
You're welcome.
By the way : Most in the above is generic (is true for all controls), and a
little (like the exact name of the usable events) was found by me looking in
the Help-file, under Slider. Just a hint ... :-)
Regards,
Rudy Wieser