Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do nesting level
Message
From
17/09/2001 07:19:38
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
17/09/2001 03:46:52
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00557186
Message ID:
00557221
Views:
18
>I have wrote a function to quick-sort' an array of objects, but when the array is a bit larger (~600), I receive an "Allowed DO nesting level exceeded." error message.
>
>I do not have any do-loop included in another do-loop, but maybe it still counted when a do-loop is included in my recursive function...
>
>Is it posible to remove this limitation, or must I rewrite my recursive function?
>
>Thanks,
>Jimi

Jimi,

It is my understanding that there is a "stack" (LIFO) for subroutine/function calls. Every time you call a program, the previous program is pushed onto the stack. Every time a program RETURNs, the previous program is pulled from the stack. It makes no difference whether the same program is called several times, or different programs are called. This is one potential problem of recursive functions.

VFP allows 128 levels; when you reach your recursive functions, some levels may be used already.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform