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.

有帮助吗?

解决方案

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
]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top