Test if a variables is defined or not

  • Thread starter Thread starter Toni
  • Start date Start date
T

Toni

I've got an unusual programming situation - in VBScript ASP.NET, can some please tell
me, how can I test if a variable has been defined with a Dim statement or not?

Thanks!

Toni
 
Andrew,

Afaik is it still posible to use VBA for scripting in Asp Net.
Therefore probably not the best, however this newsgroup is still a valid
newsgroup for the kind of problems from Toni.

Although I don't understand what he wants with his question.
As a variable is not defined there is in scripting simple an error.
A little bit strange to look if the variable is defined, simple use it.

However, what I understand from the problem.

Cor
 
Hmmm, this works in classic ASP, but with ASP.NET I get an error BC30616 "hides a
variable in an enclosed block:
http://msdn.microsoft.com/en-us/library/wtk40des.aspx

Seems silly, as if MS isn't trusting coders.

Why am I doing this? I've inherited a large sloppy poorly-written application that
haphazardly defines (Dim) certain variables in different files, instead of defining them
in a global include file. I need to catch and log errors like this, while not
interfering with the application or letting users see error messages.

Toni
 
Back
Top