Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coding puzzle (4)
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00665368
Message ID:
00665526
Views:
20
Einar:

>>>>>>>>>>
Here is one solution (I think) with only one loop and I am also using the < pre > tags for the first time ;)
for i = 1 to alen(myarray)
  if ascan(myarray, X - myarray(i)) > 0
    return myarray(i), myarray(ascan(myarray, X - myarray(i)))
  endi
next i
>>>>>>>>>>

No cigar again. ASCAN traverses (loops through) the array to locate the desired element so your solution still involves a double loop.

Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform