Thread: Snytax error
View Single Post
Old Apr 29th, 2008, 9:31 AM   #11
Freaky Chris
Hobbyist Programmer
 
Freaky Chris's Avatar
 
Join Date: Dec 2007
Location: England
Posts: 169
Rep Power: 1 Freaky Chris is on a distinguished road
Send a message via MSN to Freaky Chris
Re: Snytax error

Quote:
Originally Posted by Shamsi
(Toggle Plain Text)
String Option0=JOptionPane.showInputDialog("Enter Number to Exit from The Programme");
int z=Integer.parseInt(Option0);
if (z == 0){// 0 is the number of exiting for the programme
break;
}// to stop the programme from running String Option0=JOptionPane.showInputDialog("Enter Number to Exit from The Programme");
int z=Integer.parseInt(Option0);
if (z == 0){// 0 is the number of exiting for the programme
break;
}// to stop the programme from running
the error says"breaks outside switch or loop"
You havn't got any loops shown for you to break out of with the break statement within your if statement, so as far as i can see your trying to break out of nothing.

Chris
__________________
Who said i couldn't program
sarcasm = raw_input('Type in a sarcastic remark: ')
print sarcasm
Freaky Chris is offline   Reply With Quote