[thelist] ASP/VBSCRIPT: debugging, stepping-through, etc.

Chris W. Parker cparker at swatgear.com
Mon Jun 24 15:10:01 CDT 2002

> -----Original Message-----
> From: Tom Dell'Aringa [mailto:pixelmech at yahoo.com]
> Sent: Monday, June 24, 2002 12:38 PM
> Chris, the simplest way to debug at the outset is to print
> out stuff to yourself on the screen or
> in alerts.
> ie. = response.write("such an such variable here is:" + var)
> in various places where you need to know info. Start there,
> you may be surprised how well it
> works.

i guess i wasn't clear in my original email...

> --- "Chris W. Parker" <cparker at swatgear.com> wrote:
> > does anyone have any suggestions as to how to best debug
> > something like this? i already use a function i created
> > (called debugWrite()) that is only executed when the
> > debug variable is set to 1. but still, this doesn't help
> > too much since it's not very feasible to put a function
> > call after each line of code. but i'm all ears if you have
> > any ideas.

what you describe is what i meant by that paragraph.

Function debugWrite(toWrite)
	If(vDebug = 1) Then
		Response.Write(toWrite & "<br />")
	End If
End Function

vDebug is set as a Const at the top of each page, or the master template
page. (whatever is most global, or suits my needs.) and so i can use it
like this...

If(fartyFartVariable = "really stinky") Then
	Do something here
	Do something else
End If

debugWrite("the value of fartyFartVariable is " & fartyFartVariable)

but unfortnately, like i stated in my first email, it's not feasible to
put 1000 debugwrite() calls to figure out where the code is going
exactly at every step. the problem is that i don't know where the code
could be going wrong and there are a lot of nested functions in
different source files which makes it even more of a pain.

it's also really inefficient.


More information about the thelist mailing list