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:
00665531
Views:
14
>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

But it only looks like one loop <bg>

Einar
Semper ubi sub ubi.
Previous
Reply
Map
View

Click here to load this message in the networking platform