Thanks, Anthony.
It's hard for me to believe this, but I dropped Option Explicit
a while back while cutting and pasting code chunks into include
files, and I never put it back!!!
So I found numerous minor errors, and possibly some major
ones. The culprit variable was not declared, but it also was
not involved in any blatant outrageous mistakes that I have
found yet.
However, I have found more than one place where I
misspelled an ADO constant, using "adoCmdText" and
"adoCmdStoredProc" instead of "adCmd...". Interestingly,
fixing these broke the code in at least one new place.
Considering that the test case cannot run with these
"new" bugs, you may have steered me to a series of
mistakes I normally would have found [w/ Option Explicit].
I can't believe I did this. Anyway, for the record, here's
the code at the top of the file:
<% @EnableSessionState=False %>
<% Option Explicit %>
<% Response.Buffer = TRUE %>
<%
'
Dim blndebug
blndebug = False
'
'=========================
' C:\Program Files\Common Files\System\ADO\msado15.dll
%>
<!--
METADATA
TYPE="typelib"
uuid="2A75196C-D9EB-4129-B803-931327F72D5C"
NAME="Microsoft ActiveX Data Objects 2.8 Library"
-->
<%
'=========================
'
To address your other questions, none of the includes uses
the culprit variable. That variable is assigned in many places
and in many ways. My larger asp files use blnDebug to gate
Response.Writes of certain variables for debugging. When
blnDebug=True and Response.Buffer=False, I can see this
variable go through its paces just fine. (But turn the buffer
on, and -Boom-)
Finally, I haven't used runat="server" in ten years. I had
forgotten all about that one.
Meanwhile, I have somecode to edit and review. I'll post
again after I can run the test case again.
Thanks,
— Jim
--
James W. (Jim) Rodgers, P.E., is a Senior Partner with General Consulting
Engineers, LLC, in Atlanta, Georgia.
Anthony Jones said:
Jim Rodgers said:
Dave,
Thank you for offering to help!
You asked...
Are you pairing that with Response.Flush()?
Response.Write(...)
Response.Flush()
[line that causes error]
The answer is: with buffer=true, what you show here works.
But if you comment out the .Flush, it fails! The .Flush, which
was added for debugging the [line that causes error], prevents
the error I'm debugging!
One more comment: in the [line that causes error], I output
the function using the <%=expression%> technique. I freely
mix this with the Response.Write method throughout.
It is reminiscent of a multiprocess race hazard: as if .Flush
synchronizes something somehow. For example, does ASP
process the HTML code (including <%=expression%> tags)
in some way before running the ASP script, per se?
In the past with .html files, I've seen "out of sequence"
mysteries when there was an error in <TR> and <TD> tags
causing something "later" to appear "earlier."
The culprit variable, strManifestNum, is assured of
getting set to a date way early in the code. It seems
impossible that simply running buffer=true would cause
the expression to be evaluated before its constituent
variable, strManifestNum, is evaluated.
There are a thousand lines in this asp file. And I can't go
back to a version that "worked" because I found this while
running test cases in final QA. The test case that fails
requires much of this code, so I can't just start hacking off
limbs to see who's throwing the bad pitch.
I might have found this problem sooner if I had buffer=true
during development. But I typically set this just before I
run final QA.
Thanks for your time.
I think this 'executing out of order' theory highly unlikely. The only case
I know where this _appears_ to happen is mixing serverside script languages.
Can we just check that the basics are in place.
Everything is VBScript? (You haven't got <script runat="server" elements)
Option Explicit is the first line of code?
Response.Buffer = True is the next?
You've searched for strManifestNum and it is assigned once before use?
strManifestNum is not passed by reference to other functions?
Are there no include files that may be modifying it?
- Jim
--
James W. (Jim) Rodgers, P.E., is a Senior Partner with General Consulting
Engineers, LLC, in Atlanta, Georgia.
:
Jim Rodgers wrote:
NOTE: When buffer=true, debugging with response.write does not
work, of course: the server script fails before outputting
anything.
Are you pairing that with Response.Flush()?
Response.Write(...)
Response.Flush()
[line that causes error]
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.