Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Permutation Algorithm
Message
De
09/03/1999 07:53:15
Juan Kh
Dataprop Technologies
Sungai Petani, Malaisie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00195109
Message ID:
00195478
Vues:
21
Thank you.

Regards,
juan

>Try something like this
>
>lcString = "123"
>
>
>FOR I = 1 TO 3
> lcFirst = SUBSTR(lcString,I,1)
> FOR J = 1 TO 3
> IF J = I
> LOOP
> ENDIF
> lcSecond = SUBSTR(lcString, J,1)
> FOR K = 1 TO 3
> IF K = I OR K = J
> LOOP
> ENDIF
> lcThird = SUBSTR(lcString, J,1)
> ? LcFirst + lcSecond + lcThird
> NEXT K
> NEXT J
>NEXT I
>
>You can refine this with a call to a Function to avoid having to cascade each FOR ... NEXT loop and have it do a much longer string.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform