in reply to Syntax Error
Those lines (26 & 27) should read:
} else {
Note the braces being flipped from the way you have given. If the book really has them that way, the book is wrong.
You can see this for yourself by realizing that for every opening brace, bracket or parenthesis, there must be a matching closed one. If your editor is too simple to help you keep them balanced, you should count them yourself (and get a better editor ;-).
The general syntax for an if loop in this case looks like:
if ( CONDITION ) { BLOCK OF COMMANDS } else { BLOCK OF COMMANDS }
Your example code has ifs within ifs, but still follows this pattern.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Syntax Error
by djaesone (Initiate) on Mar 19, 2006 at 06:19 UTC | |
by Fletch (Bishop) on Mar 19, 2006 at 06:44 UTC |