How can I goto a label if the answer is incorrect?
Moderator: DosItHelp
-
- Posts: 11
- Joined: 02 May 2015 00:13
How can I goto a label if the answer is incorrect?
so, I was wondering if there was a way to make it so that if you answer anything that is not the correct answer then it goes to incorrect. put in my line of code and I wanted to know how to make it correct. [If "%problemtest1%'==" " goto incorrect]
Re: Batch
Code: Select all
IF "%problemtest1%"=="correctanswer" (
goto correct
) ELSE (
goto incorrect
)
Re: Batch
Just to make the response better tailored to the question.
ether:or:Bear in mind that the comparisons are case sensitive, to remove that include the /I switch to follow IF.
ether:
Code: Select all
IF NOT "%problemtest1%"=="correctanswer" GOTO incorrect
Code: Select all
IF "%problemtest1%" NEQ "correctanswer" GOTO incorrect