For error trapping on an asp page, I'd like to print out the name of a
variable if I find it to be null, a zerolength string, etc...

for example:

aBadString = "a"

aBadString = ""

If CheckForZeroLengthString(aBadString) then
Response.write("The variable with a zero-length string is: " &
aBadString.name)

you can't do aBadString.name, so how do you get a variable's name?

Thanks,
Mike

Re: Is it possible to get the name of a variable? by Patrick

Patrick
Fri Aug 13 03:29:42 CDT 2004

Hi Mike,

Just put the variable inside the quotationmarks:

Response.write("The variable with a zero-length string is: aBadString")

// Patrick
--
Want a script to write your documentation?
http://sydi.sourceforge.net/

"Mike" <mike_newsgroups@yahoo.com> wrote in message
news:6a68ace3.0408122251.1ccb62f@posting.google.com...
> For error trapping on an asp page, I'd like to print out the name of a
> variable if I find it to be null, a zerolength string, etc...
>
> for example:
>
> aBadString = "a"
>
> aBadString = ""
>
> If CheckForZeroLengthString(aBadString) then
> Response.write("The variable with a zero-length string is: " &
> aBadString.name)
>
> you can't do aBadString.name, so how do you get a variable's name?
>
> Thanks,
> Mike