Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 11th, 2007, 09:10 AM
Friend of Wrox
Points: 1,075, Level: 12
Points: 1,075, Level: 12 Points: 1,075, Level: 12 Points: 1,075, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: , , United Kingdom.
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default Stack Overflow Exception??

Everytime i run my code i get this stack overflow exception and its troubleshooting tips are make sure there isn't and infinite loop or recursion. What does all this mean?

Cheers

------------------------------------------------
Apocolypse2005
Always ready and waiting to be helped!
__________________
Apocolypse2005, I'm a programmer - of sorts.
Reply With Quote
  #2 (permalink)  
Old November 11th, 2007, 12:19 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

To get a better idea of what is causing this, open your call stack window in VS (Debug --> Windows --> Call Stack) and that should give you an idea of what is causing it. I assume you know what an infinte loop is and recursion can also be likend to an infite loop if implemented incorrectly, consider:

Private Sub foo()
   Dim i as Integer = 0
   While i = 0
     foo()
   End While
End Sub

So recursion is the technique whereby a Method or Function calls itself until some condition is met but, as the example above shows, there is no condition to stop the recursion since i is never incremented the While loop will continue to call the method foo()

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Reply With Quote
  #3 (permalink)  
Old January 17th, 2008, 07:06 PM
Registered User
 
Join Date: Jan 2008
Location: , , Australia.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can also get a recursion loop if your code is firing off multiple events. For example. You might handle a textchanged event on a textbox control and then modify the text accordingly, like change to uppercase for user input, but this triggers off the textchanged event again, and so on.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recursive algorithm causing stack overflow rharris VB.NET 2002/2003 Basics 8 July 7th, 2005 12:48 PM
Resursive algorithm causing stack overflow rharris Pro VB.NET 2002/2003 1 July 4th, 2005 11:00 AM
Recursive algorithm causing stack overflow rharris VB.NET 1 July 4th, 2005 10:57 AM
XSLT Stack overflow diebald XSLT 2 September 1st, 2004 12:59 AM
Urgent: Stack Trace Property of SQLCE Exception rcmetta BOOK: Professional Crystal Reports for VS.NET 1 May 11th, 2004 12:38 PM



All times are GMT -4. The time now is 11:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.