|
|
|
|
![]() ![]() |
Jan 20 2005, 05:38 PM
Post
#1
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 119 Joined: 10-October 04 Member No.: 1,657 |
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 |
|
|
|
Jan 21 2005, 03:08 AM
Post
#2
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 773 Joined: 4-November 04 Member No.: 2,118 |
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.
|
|
|
|
Jan 21 2005, 09:41 AM
Post
#3
|
|
|
Administrator ![]() Group: Admin Posts: 1,479 Joined: 11-June 04 From: Somewhere in Time & Space. Member No.: 1 |
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. |
|
|
|
Jan 21 2005, 12:49 PM
Post
#4
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 114 Joined: 9-August 04 From: Suzhou Jiangsu China Member No.: 743 |
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. |
|
|
|
Jan 23 2005, 02:47 PM
Post
#5
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 119 Joined: 10-October 04 Member No.: 1,657 |
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 |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 11th October 2008 - 08:34 AM |