LPARAMETER nFind LOCAL nFront, nBack, nSum DIMENSION a[10] a[1]= 3 a[2]= 5 a[3]= 7 a[4]= 9 a[5]= 10 a[6]= 12 a[7]= 14 a[8]= 16 a[9]= 18 a[10]= 20 nFront= 1 nBack= ALEN(a) nSum= a[nFront] + a[nBack] DO WHILE nSum != nFind AND nFront != nBack IF nSum > nFind nBack = nBack - 1 ENDIF IF nSum < nFind nFront= nFront + 1 ENDIF nSum= a[nFront] + a[nBack] ENDDO IF nFront != nBack ? a[nFront], a[nBack] ELSE ? "Not Found" ENDIFKeep a pointer to the front, and one to the back, If the sunm is greater, move the back pointer in one, if the sum is less move the front pointer in one.