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.

DarkBASIC Professional Discussion / Is recursion working ?

Author
Message
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 13th Nov 2002 23:45
In the following code :



I'm using recursion to re-draw the menu. However, without the text command in createMenu routine, the program crashes...

Has anyone else had this problem ?
Yes, I really am THAT good...
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 14th Nov 2002 10:34
I have not had to use recursion yet.

Thats quite a large bit of code to Debug, particularly without the rest of the code/dll`s to test it.

I would try to reduce the code, REM out bits and see if you can pinpoint the one thats crashing.

For the recursion you could use a counter to see at what level it crashes (if its not obvious by which menu`s your opening).

I also put a couple of little functions in every one of my projects which allow me to open and write to a debug file in a simple single command, perhaps you could try something similar.

Otherwise if you can reduce the code to something that I can just copy & paste in and run on my PC then I can confirm whether I get the same problem.
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 14th Nov 2002 11:07
The following works :



so I'm wondering one of my DLL's is overwriting memory. I'll have to check that later.

Yes, I really am THAT good...
Lee Bamber
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location:
Posted: 15th Nov 2002 22:10
Could not debug as it needs constants (as though part of a much larger program). I can find the problem if you email me your project to lee@darkbasic.com. Recursion should work fine providing you don't exceed the 2MB stack limit.

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 16th Nov 2002 00:08
I'll package it up and send it to you soonish...

Yes, I really am THAT good...
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 16th Nov 2002 00:14
Actually, it seems to be working okay now - possibly some errors I had earlier was overwriting memory.

Yes, I really am THAT good...

Login to post a reply

Server time is: 2024-04-25 08:14:49
Your offset time is: 2024-04-25 08:14:49