0 Replies - 1870 Views - Last Post: 13 September 2012 - 11:14 AM Rate Topic: -----

#1 MiguelRosso  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 31-July 12

BATCH Question about IF Statements

Posted 13 September 2012 - 11:14 AM

Hello everybody! I'm having some problems with a batch code. This is the code:
@echo off
echo TESTGAME
set answer
echo 1)Play Game
echo 2)Exit
set /p answer=0

if %answer%==1 (
cls
echo 1)[blahblah]
echo 2)[blahblah]
set /p answer=
if %answer%==1(
echo [blahblah]
)
if %answer==2 (
echo [blahblah]
)
)
if %answer%==2 (
exit
)


When I open the game, The first input (the game menu input) appears, but when I type in something and press enter it closes. What's the problem here?
Can't there be an if statement inside an if statement?
Thanks!

Is This A Good Question/Topic? 0
  • +

Page 1 of 1