I finally found what I was looking for in the basic core for all my pull-parser needs. With the help of those at Run Rev this was found:So, one idea is to implement a function: matchGlobal(stringToSearch, token) returning a list of all indices in stringToSearch of token.
e.g. get matchGlobal("<a>foo</a><a>bar</a><a>baz</a>", "<a>") would give it[1] = 1 it[2] = 10 it[3] = 20
The functionality sounds good, but may I put in a vote for readable syntax, instead of this C-like horror? ;-) For example, this one has been discussed pretty extensively on the Xtalk list:
get the offsets of "<a>" in "<a>foo</a><a>bar</a><a>baz</a>"
returning either the array as above (although I'm a bit allergic to arrays in cases where they're not absolutely needed - difficult to display for debugging, etc.), or, as in most return values, a simple comma-delimited list: 1,10,20.
There are some advantages, since "offset" already exists and so "offsets" leverages off developer knowledge of that function. The syntax is also cleaner than the existing "offset" syntax, which has been a rough spot ever since HyperTalk 1.0, so making the obvious extension to the offset function might not be a bad idea. This could also be extended to word offsets, item offsets, and line offsets matching the current "offset" function variants.
--
jeanne a. e. devoto ~ [EMAIL PROTECTED]
http://www.jaedworks.com
_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution
