I merged these two topics...
As for the code. Penny is probably right. You need to restructure your code in a clean manner. This will get ride of most of your syntax/structural errors and let you concentrate on logic.
When you write and IF statement use the following format:
CODE
if(condition)
{
block of code
} else
{
the else block
}
Note that I didn't use a semi-colon at the end of the if or else lines.
Use indentation to your advantage. You can make you code much clearer. Your code above is a bit confusing because its indentation (which may just be a result of copy/paste).
Use comments. This really helps! First of all it will help you think over the logic of your code as you go. Secondly, when you post your code it helps us understand what you are trying to do, so maybe we can comment more on logic and less on syntax.
I know programming can be frustrating. Computers REQUIRE you to do things correctly. Your code will not function with syntax error, and you posts will not be properly formated unless you use the proper tags.
take a breath, get something to drink and come back to it.
BTW -- you can always edit your post if you find that it didn't format they way you wanted it to... even I have messed up the [code] tags from time to time and had to edit the post to get it right.