On Jul 23, 2007, at 6:53 AM, stillroach wrote:
> Hi, is there a way to change the min, max and increment
setting of a
> slider from within the code?
>
> Similarly is there a way i can use the current
settings of these as a
> value within the code?
>
> Thanks
>
> Alan
Alan,
The answer is no for NetLogo 3.1, but YES for NetLogo 4.0
(beta 3).
In NL4, all three settings in the Slider's dialog box can be
constant
values, global variables, or reporters. For example, to see
how they
can be global variables, paste this into the Procedures of a
new NL4.0
model:
globals [ slider-min slider-max slider-incr ]
to test
set slider-min 7
set slider-max 27
set slider-incr 2.5
end
Then in the Interface, make a slider and type the three
global variable
names into the dialog box for the max, min, and increment
values. Then
type 'test' into the Command Center, or just set these
variables to
different values and see the results on the slider.
So to change the settings, you set the global variables. To
use them,
you just use the global variables.
HTH,
Jim
|