Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do nesting level
Message
 
 
À
17/09/2001 03:46:52
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00557186
Message ID:
00557196
Vues:
20
Hi!

Any recursive function could be re-written to use a loop instead of recursive call.

However, I'm wondered - WHY not use ASORT() function????????
dimension MyObjects(nObjectsCount,2)
for i=1 to nObjectsCount
MyObjects(i,1) = ... && some object reference
MyObjects(i,2) = ... && value used for comparison for sorting
endfor

ASORT(MyObjects,2)

And thats all.
This way should be MUCH more quick then just a custom sorting algorithm.

HTH.

Make array 2-dimensioned with 2 columns. One contains object reference. Another column contains value which you use for sorting. Then use ASORT(aArray,)

>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
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform