문제

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