Question

I am trying to throw an error (user defined and not the netLogo runtime error ) if one button is pressed before the other. I have three buttons " SETUP" , "CONFIGURE", " SIMULATE" . I want to throw an error if SIMULATE is clicked before CONFIGEURE. I know there is a primitive available " user-message" as mentioned by Sir.Seth Tisue in my other question, but do not know how to include it for my situaton.

Was it helpful?

Solution

Make a global configured?. Have configure set it to true. Then in simulate, put:

if configured? != true [
  user-message "You must press configure first"
  stop
]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top