473,513 Members | 2,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debug Local Variables

Hi,

Does anyone happen to have a debug script that will display the variable
name and value for all of the local variables on an .asp page? (not session
nor application, as I already have scripts those.) I'm looking for
something that can be included in an .asp to write out values for debugging.
Does anyone know what scope those variables reside in?

Please help if you can.

Thanks,
-Rigs
Jul 19 '05 #1
4 2016
There is no functionality built in to ASP that will do this for you, no.
You'd have to response.write them where you want them. If your pages just
consist of ASP code not contained in any subs or anything, your vars will
have global scope in the page. So, you could write a function to display
your values and just call that function where you need it.

<%
Dim a, b, c, d

'''code, code, code
Call WriteVals("line 32")

'''code, code, cone
Call WriteVals("Just created e-mail object")

'''code, code, code
Call WriteVals("About to insert data into database."
Function WriteVals(MarkerStatement)
Response.Write "<hr>"
Response.Write MarkerStatment & "<br>"
Response.Write "a=" & a & "<br>"
Response.Write "b=" & b & "<br>"
Response.Write "c=" & c & "<br>"
Response.Write "d=" & d
End Function
%>
Be sure you use Option Explicit.

Ray at work


"Rigs" <jc******@spartanmotors.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi,

Does anyone happen to have a debug script that will display the variable
name and value for all of the local variables on an .asp page? (not
session
nor application, as I already have scripts those.) I'm looking for
something that can be included in an .asp to write out values for
debugging.
Does anyone know what scope those variables reside in?

Please help if you can.

Thanks,
-Rigs

Jul 19 '05 #2
Ray,

Thanks, but I am looking for more of a collection type solution.
Response.write would be quite tedious for this page. (lots of vars for
calcs and such...)

Is "global" part of a collection? That way I could write out the variables
and their values like I do with the session vars? Below is my session var
code. I am 'hoping' there's an equivalent for local global variables.

Session write out code:
For Each Item in Session.Contents
Response.write Item & " = " & Session.Contents(Item) & "<BR>"
For Each ItemKey in Session.Contents(Item)
Response.Write "Sub Item: " & Item & " (" & ItemKey & ") : " _
& Session.Contents(Item)(ItemKey) & "<br>"
Next
Next

Please let me know your thoughts either way and thanks again for your help.
-Rigs
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:O5****************@TK2MSFTNGP12.phx.gbl...
There is no functionality built in to ASP that will do this for you, no.
You'd have to response.write them where you want them. If your pages just
consist of ASP code not contained in any subs or anything, your vars will
have global scope in the page. So, you could write a function to display
your values and just call that function where you need it.

<%
Dim a, b, c, d

'''code, code, code
Call WriteVals("line 32")

'''code, code, cone
Call WriteVals("Just created e-mail object")

'''code, code, code
Call WriteVals("About to insert data into database."
Function WriteVals(MarkerStatement)
Response.Write "<hr>"
Response.Write MarkerStatment & "<br>"
Response.Write "a=" & a & "<br>"
Response.Write "b=" & b & "<br>"
Response.Write "c=" & c & "<br>"
Response.Write "d=" & d
End Function
%>
Be sure you use Option Explicit.

Ray at work


"Rigs" <jc******@spartanmotors.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi,

Does anyone happen to have a debug script that will display the variable
name and value for all of the local variables on an .asp page? (not
session
nor application, as I already have scripts those.) I'm looking for
something that can be included in an .asp to write out values for
debugging.
Does anyone know what scope those variables reside in?

Please help if you can.

Thanks,
-Rigs


Jul 19 '05 #3
Unfortunately, no, there is no collection you can itterate through. This
question has come up a number of times, and I do not recall anyone coming up
with anything to solve this need yet. :[

Ray at work

"Rigs" <jc******@spartanmotors.com> wrote in message
news:ek**************@TK2MSFTNGP10.phx.gbl...
Ray,

Thanks, but I am looking for more of a collection type solution.
Response.write would be quite tedious for this page. (lots of vars for
calcs and such...)

Is "global" part of a collection? That way I could write out the
variables
and their values like I do with the session vars? Below is my session var
code. I am 'hoping' there's an equivalent for local global variables.

Session write out code:
For Each Item in Session.Contents
Response.write Item & " = " & Session.Contents(Item) & "<BR>"
For Each ItemKey in Session.Contents(Item)
Response.Write "Sub Item: " & Item & " (" & ItemKey & ") : " _
& Session.Contents(Item)(ItemKey) & "<br>"
Next
Next

Please let me know your thoughts either way and thanks again for your
help.
-Rigs
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:O5****************@TK2MSFTNGP12.phx.gbl...
There is no functionality built in to ASP that will do this for you, no.
You'd have to response.write them where you want them. If your pages
just
consist of ASP code not contained in any subs or anything, your vars will
have global scope in the page. So, you could write a function to display
your values and just call that function where you need it.

<%
Dim a, b, c, d

'''code, code, code
Call WriteVals("line 32")

'''code, code, cone
Call WriteVals("Just created e-mail object")

'''code, code, code
Call WriteVals("About to insert data into database."
Function WriteVals(MarkerStatement)
Response.Write "<hr>"
Response.Write MarkerStatment & "<br>"
Response.Write "a=" & a & "<br>"
Response.Write "b=" & b & "<br>"
Response.Write "c=" & c & "<br>"
Response.Write "d=" & d
End Function
%>
Be sure you use Option Explicit.

Ray at work


"Rigs" <jc******@spartanmotors.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> Does anyone happen to have a debug script that will display the
> variable
> name and value for all of the local variables on an .asp page? (not
> session
> nor application, as I already have scripts those.) I'm looking for
> something that can be included in an .asp to write out values for
> debugging.
> Does anyone know what scope those variables reside in?
>
> Please help if you can.
>
> Thanks,
> -Rigs
>
>



Jul 19 '05 #4
That stinks... But thanks for your input. What was MS thinking when it
left those vars out of a collection, yet placing all other vars in one!?!?
I appreciate your assistance.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e1**************@TK2MSFTNGP11.phx.gbl...
Unfortunately, no, there is no collection you can itterate through. This
question has come up a number of times, and I do not recall anyone coming up with anything to solve this need yet. :[

Ray at work

"Rigs" <jc******@spartanmotors.com> wrote in message
news:ek**************@TK2MSFTNGP10.phx.gbl...
Ray,

Thanks, but I am looking for more of a collection type solution.
Response.write would be quite tedious for this page. (lots of vars for
calcs and such...)

Is "global" part of a collection? That way I could write out the
variables
and their values like I do with the session vars? Below is my session var code. I am 'hoping' there's an equivalent for local global variables.

Session write out code:
For Each Item in Session.Contents
Response.write Item & " = " & Session.Contents(Item) & "<BR>"
For Each ItemKey in Session.Contents(Item)
Response.Write "Sub Item: " & Item & " (" & ItemKey & ") : " _
& Session.Contents(Item)(ItemKey) & "<br>"
Next
Next

Please let me know your thoughts either way and thanks again for your
help.
-Rigs
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:O5****************@TK2MSFTNGP12.phx.gbl...
There is no functionality built in to ASP that will do this for you, no. You'd have to response.write them where you want them. If your pages
just
consist of ASP code not contained in any subs or anything, your vars will have global scope in the page. So, you could write a function to display your values and just call that function where you need it.

<%
Dim a, b, c, d

'''code, code, code
Call WriteVals("line 32")

'''code, code, cone
Call WriteVals("Just created e-mail object")

'''code, code, code
Call WriteVals("About to insert data into database."
Function WriteVals(MarkerStatement)
Response.Write "<hr>"
Response.Write MarkerStatment & "<br>"
Response.Write "a=" & a & "<br>"
Response.Write "b=" & b & "<br>"
Response.Write "c=" & c & "<br>"
Response.Write "d=" & d
End Function
%>
Be sure you use Option Explicit.

Ray at work


"Rigs" <jc******@spartanmotors.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> Does anyone happen to have a debug script that will display the
> variable
> name and value for all of the local variables on an .asp page? (not
> session
> nor application, as I already have scripts those.) I'm looking for
> something that can be included in an .asp to write out values for
> debugging.
> Does anyone know what scope those variables reside in?
>
> Please help if you can.
>
> Thanks,
> -Rigs
>
>



Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1500
by: João Santa Bárbara | last post by:
Hi all, i have a function in VB.NET which is too big when i try to debug it, i can´t . is there a FIX for it ??? JSB
3
2506
by: Stephanie | last post by:
I have a problem that I am trying to solve. We have a huge product with a whole lot of ASP and VB code. VB code is all ActiveX dlls which are used by ASP app. When I attempt to add features or fix...
1
2370
by: joemynz | last post by:
Help please with a URLError. Invoking a url that works in Firefox and IE results in a "urlerror 7, no address ..." in python. I need to debug why. Traceback is below. There's a redirect when the...
46
24134
by: Ian Boyd | last post by:
IIS5, on a Windows 2000 Server machine. Debeg.WriteLine "Hello, world!" How can i view it?
2
2359
by: Epetruk | last post by:
Hello, I have a problem where an application I am working on throws an OutOfMemoryException when I run it in Release mode, whereas it doesn't do this when I am running in Debug. The...
2
22837
by: Bill_DBA | last post by:
I have the following stored procedure that is called from the source of a transformation in a DTS package. The first parameter turns on PRINT debug messages. The second, when equals 1, turns on the...
6
5939
by: Scubadude | last post by:
Hi, I'm new to perl and have run into some roadblocks while trying to run tutorials. I have installed Apache v2.2.3 I have installed ActivePerl v6.6.1.638 I have installed php v5.2.0 I am...
55
6151
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
3
3362
by: =?Utf-8?B?bG10dGFn?= | last post by:
We have developed a number of different applications (ASP.NET web site, Windows services, DLLs, Windows forms, etc.) in C# 2.0. We have developed and unit tested all these applications/components...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.