user3369125
user3369125

Reputation: 165

Throwing errors in a dialog box

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.

Upvotes: 1

Views: 176

Answers (1)

Bryan Head
Bryan Head

Reputation: 12580

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
]

Upvotes: 2

Related Questions