Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Permutation Algorithm
Message
From
09/03/1999 07:53:15
Juan Kh
Dataprop Technologies
Sungai Petani, Malaysia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00195109
Message ID:
00195478
Views:
20
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform