Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 19th, 2005, 02:51 PM
usalabs usalabs is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 6 usalabs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old January 19th, 2005, 02:57 PM
banker's Avatar
banker banker is offline
Charging Rhino Wizard
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Dec 2004
Location: 127.0.0.1
Posts: 2,053 banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 23 h 28 m 28 sec
Reputation Power: 36
the name "rsConfig" would suggest a Record Set. In other words, the results of a database query.

Reply With Quote
  #3  
Old January 19th, 2005, 09:59 PM
usalabs usalabs is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 6 usalabs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by banker
the name "rsConfig" would suggest a Record Set. In other words, the results of a database query.


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.

Reply With Quote
  #4  
Old January 20th, 2005, 06:20 AM
lewy's Avatar
lewy lewy is offline
Alter Ego Wizard
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Edinburg Tx
Posts: 4,376 lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 1009 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 1 Day 21 h 21 m 31 sec
Reputation Power: 1391
Post the rest of the code.

Reply With Quote
  #5  
Old January 20th, 2005, 06:37 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,969 Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 5 Days 15 h 9 m 16 sec
Reputation Power: 1556
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.

Reply With Quote
  #6  
Old January 21st, 2005, 10:43 AM
shamrog12's Avatar
shamrog12 shamrog12 is offline
Newton's Apple Wizard
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 1,661 shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 2 h 39 m 22 sec
Reputation Power: 34
Send a message via AIM to shamrog12
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.


Reply With Quote
  #7  
Old January 22nd, 2005, 01:43 AM
usalabs usalabs is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 6 usalabs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by lewy
Post the rest of the code.


I would if I could, but the code is far to big to post here (20.8Kb).

Maybe I can email it to someone.

Reply With Quote
  #8  
Old January 22nd, 2005, 01:48 AM
usalabs usalabs is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 6 usalabs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by shamrog12
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.


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.

Reply With Quote
  #9  
Old January 22nd, 2005, 08:59 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,969 Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342274 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 5 Days 15 h 9 m 16 sec
Reputation Power: 1556
just for the sake of debugging, remove the Application.Lock and Application.UnLock lines - I predict your code won't get into endless loop.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > ASP script goes into endless loop.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway