Documentaion update request for "find"
- Posted by alanjohnoxley Sep 15, 2010
- 1197 views
Hi, the online docs for "find" don't seem to be correct:
9.3.2 Finding
9.3.2.1 find
<built-in> function find(object needle, sequence haystack, integer start)
Find the first occurrence of a "needle" as an element of a "haystack", starting from position "start"..
Looks like this is a "find_from" since it mentions the start position?
Also, this issue could have been mentioned too:
-- -- show the one level limitation of "find" function, -- and its derivatives such as find_from -- 15th Sept 2010 Euphoria v4.0 svn v3412 -- -- "find" will work on a one dimentional sequence only. -- sequence onedimentional, twodimentional onedimentional = {"one","two","three"} twodimentional = {{"one","two","three"}, {"four","five","six"}} procedure test() integer i1, i2 sequence arg, s1, s2 arg = "two" -- i1 = find(arg,onedimentional) s1 = sprintf("%1d",{i1}) -- i2 = find(arg,twodimentional) s2 = sprintf("%1d",{i2}) -- puts(1,"\nOne dimentional sequence find gave " & s1 & "\n") puts(1,"Two dimentional sequence find gave " & s2 & "\n") end procedure test()
"find" is working as designed; for the multi-dimentional find I would need to write my own routine that would return a sequence of nesting level and position.
Regards,
Alan