Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do nesting level
Message
De
17/09/2001 04:58:53
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:
00557205
Vues:
21
hi Vlad,

i didn't use the asort() because I'm sorting something like:
1, 2, 2A, 3, 3A, 3B, 10, 10A...etc.

since 2A 3A are valid, I cannot use integer but strings, but at the same time 10 must be larger than 2 that for string comparsion foxpro would think 2 is larger... I dunno how to fix this so I used a custom sorting..

any idea?

Jimi

>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
error(503): file structure failure, signature file corrupted.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform