Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Getting Rid Of Errors


4 replies to this topic

#1 dark

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 119 posts

Posted 20 January 2005 - 05:38 PM

Hi

Is it ok to use error-reporting(0) locally in a snippet of code that spits an undefined variable error?
I found that fix and was wondering what does everybody do about error messages that keep poping up.

Thanks

Patrick

#2 no9t9

    Privileged Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 773 posts

Posted 21 January 2005 - 03:08 AM

my scripts don't have error messages... try to find out what's wrong and fix it. or try to do it a different way. there is always more than one way to do something in programming.

#3 OpaQue

    Administrator

  • Admin - The Official Guru
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1,894 posts
  • Gender:Male
  • Location:Somewhere in Time & Space.
  • Interests:Discovering Myself.
  • myCENT:55.78

Posted 21 January 2005 - 09:41 AM

Turnning off the error reporting function can sometimes make it hard to track the errors.. So debugging becomes extremely difficult. You can use an include file on top to set this option for all the files. So while you are debugging you can temporarily disable it.

The other option which you have is using the "@" symbol. If you preceed any function with it, the errors are suppressed but they are limited to that line of code only.

#4 LuciferStar

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 114 posts
  • Location:Suzhou Jiangsu China

Posted 21 January 2005 - 12:49 PM

try to make your codes work well,
or try '@' before every function you have to use,like

@count($emptyarray);
@fopen("","w");

if you do so,then no error message will be displayed.

#5 dark

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 119 posts

Posted 23 January 2005 - 02:47 PM

Hi

This is the original poster. Thanks so much for the kind answers and the @ tip, I am going to try to use it asap.
While browsing the web for answers to my problem, I came upon a snippet of code that showed how a variable that sometimes isn't defined creates an error with the parser. So including this variable code in an IF statement would prevent the error also.
Like someone said above, there are several solutions to fix that.

Thanks again

Patrick




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users