| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP script goes into endless loop.
The code (part of a configuration file) listed below, (when debugged using ms script debugger) seems to put the script into an endless loop, does anyone know why this is?
if blnLoadConfig then Application.Lock do while not rsConfig.EOF Application(strCookieURL & Trim(UCase(rsConfig("C_VARIABLE")))) = Trim(rsConfig("C_VALUE")) rsConfig.MoveNext loop Application.UnLock rsConfig.close end if and also is there an interpreter for asp scripts that can run the script(s) line by line and show the values of variables, because, looking at the above code, I have no idea what rsConfig, rsConfig("C_VARIABLE"), and rsConfig("C_VALUE") is, I know that the () variables are arrays of some kind, but I have no means of finding out what the values are. |
|
#2
|
||||
|
||||
|
the name "rsConfig" would suggest a Record Set. In other words, the results of a database query.
|
|
#3
|
|||
|
|||
|
Quote:
How can I findout what the results are? The config.asp file is called by a setup file, which creates the tables in the 'access' database, the config.asp file has the correct connection string for the access database I use, and the databse folder and database file, has user permissions set for write access, but how would the above code cause an endless loop?, how can the endless loop be prevented. |
|
#4
|
||||
|
||||
|
Post the rest of the code.
|
|
#5
|
||||
|
||||
|
the code should not cause any endless loop, but you better have such code, just so we'll be certain:
Code:
if blnLoadConfig then
do while not rsConfig.EOF
Application.Lock
Application(strCookieURL & Trim(UCase(rsConfig("C_VARIABLE")))) = Trim(rsConfig("C_VALUE"))
Application.UnLock
rsConfig.MoveNext
loop
rsConfig.close
end if
on second thought, you might get error in the line where you set application level variable and the application is locked... that might indeed cause the application itself to freeze. |
|
#6
|
||||
|
||||
|
maybe try:
if blnLoadConfig then Application.Lock while not rsConfig.EOF Application(strCookieURL & Trim(UCase(rsConfig("C_VARIABLE")))) = Trim(rsConfig("C_VALUE")) rsConfig.MoveNext wend Application.UnLock rsConfig.close end if instead. that way you don't run the code if your predicate isn't true during the first iteration.
__________________
If you found a post of mine helpful, please click on the on my post to add to my reputation.
|
|
#7
|
|||
|
|||
|
Quote:
I would if I could, but the code is far to big to post here (20.8Kb). Maybe I can email it to someone. |
|
#8
|
|||
|
|||
|
Quote:
I tried the above code, but still the same. Notice the [--->], that is the line that gets shown everytime I issue a 'break on next statement' in MS script debugger. |
|
#9
|
||||
|
||||
|
just for the sake of debugging, remove the Application.Lock and Application.UnLock lines - I predict your code won't get into endless loop.
|
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > ASP script goes into endless loop. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|