Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / recursion doesn't work??

Author
Message
Llag
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location:
Posted: 11th Oct 2003 08:11
why doesn't this work:

Easily Confused
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 11th Oct 2003 18:26 Edited at: 11th Oct 2003 18:46
Recursion does work (in DBPro anyway) and your snippet is working to a point, added something to see what's going on in there:



...but your snippet was stuck in a loop and very quickly ran out of stack space, a common problem if a function calls it'self too many times.

Because functions can't return multiple return values (yet!) I find recursion works best with global variables.



The downside of recursion is it can be very hard to follow what's going on, making debugging a pain in the... I'll let you finish that sentence

Hope this helps

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Oct 2003 19:14
Recursion is my friend

But like Confused says, make sure you have it under control.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Llag
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location:
Posted: 11th Oct 2003 23:06
oh ok i found the problem...


hooray for recursion!

Login to post a reply

Server time is: 2024-11-25 13:52:55
Your offset time is: 2024-11-25 13:52:55