IF Statement in batch not working?

前端 未结 1 596
栀梦
栀梦 2021-01-16 06:14

I\'m coding a game in batch right now, and I\'ve not gone very far when I encountered this problem. I\'m trying to set a variable for a user answer, then use that answer for

相关标签:
1条回答
  • 2021-01-16 06:35

    That's because %Answer1% is not defined.

    set /p Answer1 = "Enter your choice: "
    

    sets a variable named %Answer1 % (note the space!)

    Remove the spaces around the =.

    0 讨论(0)
提交回复
热议问题