AKarr
AKarr

Reputation: 183

Why does netlogo think this input is a true/false rather than a number?

I have the code:

  ;; in one command block
    set J J = -1
    set A A = -1
  ;; in another command block
   every 6 [ set J J = -1]

When I press the button that corresponds to the second command block I get the runtime error "- expected input to be a number but got the TRUE/FALSE false instead". What is causing this and what should I do to remedy the problem. Thanks for any help.

Upvotes: 0

Views: 305

Answers (1)

Bryan Head
Bryan Head

Reputation: 12580

set J J = -1 tests to see if J is equal to -1 and then sets J to the result. You want:

  ;; in one command block
    set J -1
    set A -1
  ;; in another command block
   every 6 [ set J -1 ]

Upvotes: 3

Related Questions