Question about creating a library app

I’m making a borrow system,
I got a text and when i click “borrow”

  1. set the virable “ifBorrow” to “true”
  2. call “check name and number function”
    (i also have giveBack button, so check name and number not only for borrow)
  3. in the function, if the name is empty, then alert errorA
  4. in the function, else if the number is less then 1, alert errorB
  5. in the function, else if the number we want to borrow more then we have, alere errorC

I try as following but something wrong :
if i didn’ select name, alere errorA -> it’s correct
else if i input 0, alert errorB -> it’s correct

then something happaned, now i set the number we have is 2
when i input 3 to the text
the system will alert errorB, then i click the button again without change anything,
the system alert errorC, always the second time,
but when i change the input to 0,
the system alert errorB again at the frist time,

then i make a new alert to check the input,
the first time whe i input 3, the check alert show the input is 3,
but the system still alert errorB, and the second time will be correct alert errorC

i don’t know what happened…

Can you post a screenshot of your blocks? I’m finding it hard to visualize everything just from a written description.

1 Like