A tip on avoiding errors cause by not enough }'s is to close any bracket
immediately after you open it, so if I were writing a block of code: 

function foo(){
}

I would write the above first, and then fill in between the {}'s.  This
way, when I get to the end of my script, I know I'm at least not missing
any curly braces.  You can do this with others, but these are usually
the hardest to track down once you have a large amount of code (with a
large number of {}).  

I know this is painfully obvious, but it does help. 

gabe. 

On Tue, 2003-07-29 at 09:33, Peter James wrote:
> Just forwarding this reply back to the list.
> 
> ----- Original Message ----- 
> From: "Chris W. Parker" <[EMAIL PROTECTED]>
> To: "Peter James" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 29, 2003 10:26 AM
> Subject: RE: [PHP] debuging and getting mor information about failures
> 
> 
> Peter James <mailto:[EMAIL PROTECTED]>
>     on Tuesday, July 29, 2003 9:18 AM said:
> 
> > These errors are usually caused by an extra or missing brace or
> > quote/apostrophe/backtick.  The best way to find where this is
> > happening is to use another error.
> [snip]
> > This is a very frustrating error message[snip]
> 
> It also helps to learn what to look out for. Not to say that I won't
> ever have the need, but I've never needed to deliberately introduce one
> error just to find another one, especially when it's a syntax error.
> 
> The best thing to do is just get used to scanning your lines of code for
> proper syntax. Make sure you always have a ; at the end of each
> statement, make sure your curly braces line up, etc.
> 
> Another thing that be making this error difficult for you to find is
> because of your coding style. Your code could possibly be written in
> such a way that it doesn't make scanning it too easy therefore making it
> hard to find such tiny errors.
> 
> 
> hth,
> chris.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to