Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable is undefined help

Status
Not open for further replies.

x6213

Programmer
Aug 17, 2005
17
US
I get a "Variable is undefined" error but I have no idea which variable. I'm editing pre-existing code and there are numerous variables, so the only way I've been able to debug is to ' comment out each variable one by one and see if the error stops to find the faulty variable, but this is very time consuming.
Is there a way to make the error show which variable is undiffined? (such as an error sub
(btw, using vbscript and legacy asp )
thank
 
are you using

<%Option Explicit%> on the top of your page...

-DNG
 
yes, it's the first line of my global include
 
also put on the top of the page on which you are getting errors...

Turning on this option helps to identify undefined variables...

-DNG
 
the thing is that you should receive error which looks something like this:

Variable is undefined: varname

but as per your post i dont think you are seeing this kind of error...

what is the actual error that you are getting...

-DNG
 
this is what shows

Technical Information (for support personnel)
Variable is undefined


but no varname
 
can you post the code here or is it very big to post...also if you atleast post the suspicious parts of your code..that will do...

-DNG
 
and i think that you are using a custom error page...turn that off for a moment to see the actual error...

-DNG
 
Does it say anything after Variable is undefined?

Did you turn off the "show friendly errors" option?
 
Sheco,

By looking at the error he posted, dont you think it is a custom error page??

-DNG
 
Could be but also the default friendly error has the same or similar wording.. something about "for support personnel"
 
the actual Err.Description is just "Variable is undefined
 
may be Err.Number or Err.Source might give any additional help...but go ahead and uncheck show friendly HTTP error messages in the Internet Tools ->options...

-DNG
 
ok, i feel stupid. It was a "On Error Resume Next" set in one of the includes. Now I get a line number of the error, thanks for all your help everyone.
 
Don't feel stupid, that kind of thing happens to everyone.
 
I agree...only these kind of little things always are the diffcult and most time consuming one...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top