Did the code I gave you not work? The one here below with DIMENSION ?

> >

> > Why not SQL?

> > Please check again, i'm not 100% sure.

> >

DIMENSION aResults[1]
> > Permutation('5084')
> > DIMENSION aResults[ALEN(aResults)-1] && remove last el
> > =ASORT(aResults) && you sort it...
> > =ACOPY(aResults,aNewResults,2) && copy to new array, move elements 1 up
> > aNewResults[ALEN(aResults,1)]=0 && replace .f. with 0
> > FOR i =1 TO ALEN(aResults,1)
> > IF aResults[i]<>aNewResults[i]
> > ? aResults[i] && if not same, it's not duplicate.
> > ENDIF
> > NEXT
> > ***************************
> > function Permutation
> > lparameters tcWord,tcPrefix
> >
> > if empty(tcPrefix)
> > clear
> > tcPrefix=""
> > endif
> > do case
> > case len(tcWord)=0
> > *Nothing to do
> > case len(tcWord)=1
> > aResults[ALEN(aResults)]=VAL(tcPrefix+tcWord)
> > DIMENSION aResults[ALEN(aResults)+1]
> > otherwise
> > local xx
> > for xx=1 to len(tcWord)
> > Permutation(left(tcWord,xx-1)+substr(tcWord,xx+1),tcPrefix+substr(tcWord,xx,1))
> > endfor
> > endcase
> >

> >

> > Regards

> > Samir

>

>

> It is because that is the requirement of the project.

> I cannot use the SQL.

> I want to get the combination, not the permutation.

>

> Thanks for Mr Samir.H for try to help me.

> If can, please help me to get the combination of number without using SQL.

>

> Thanks a lot.

>

> peng

Regards

Samir