The problem is that you're passing `on` as the value for `selection`, but `on` isn't a NetLogo value. If you pass `true` to turn it on (or `false` to turn it off), it should do what you want.

If you run into problems like this in the future, you might find it helpful to test that the code you're supplying in `workspace.command` works in the Command Center of the NetLogo application.

On 11/07/2015 12:53 PM, Getachew Feleke Belete wrote:

I am accessing NetLogo model from NetBeans IDE. To set numeric type variable called ‘price’ (which is represented by sliders on the GUI) I use

          workspace.command("set price 4");

and it works fine. Similarly there is variable called ‘selection’ (which is represented by Button on the GUI) with value of either ‘on’ or ‘of’. To set this variable I use

        workspace.command("set selection on");

and I am getting error. How can we set text values to variables on the workspace?

With regards,

Getachew

--
You received this message because you are subscribed to the Google Groups "netlogo-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to