Вопрос

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