Anonymous user
Search a list: Difference between revisions
→MAXScript
m (→{{header|J}}: code corrected, remove request) |
|||
Line 196:
Washington is not in haystack
4 Bush
</pre>
=={{header|MAXScript}}==
<pre>
haystack=#("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo")
for needle in #("Washington","Bush") do
(
index = findItem haystack needle
if index == 0 then
(
format "% is not in haystack\n" needle
)
else
(
format "% %\n" index needle
)
)
</pre>
Output:
<pre>
Washington is not in haystack
5 Bush
</pre>
|