Interesting wordOffset behavior
Robert Sneidar
slylabs13 at me.com
Mon Dec 3 21:28:44 EST 2012
Wordoffset returns space delimited data.
Bob
On Dec 3, 2012, at 10:36 AM, Peter Haworth wrote:
> I'm finding that wordOffset treats comment chars as a word even if they
> are immediately followed by another character.
>
> For example:
>
> wordOffset("--","repeat with x=1 to 100 --check something")
>
> ...returns 6. I would have expected it to return zero since there is
> no occurrence of "--" surrounded by spaces or quotes.
>
> To add to the plot:
>
> put word 6 of "repeat with x=1 to 100 --check something"
>
> ...returns "--check"
>
> And:
>
> wordOffset("--","repeat with x=1 to 100 -- check something")
>
> ...also returns 6 (there's a space between the comment chars and "check" in
> this example).
>
> It turns out that this is useful in the context of what I'm doing but
> whenever I run into what I think is unexpected behavior like this, I'm wary
> of using it in case it's actually a bug that might get fixed at some point
> and break my code.
>
> Am I being over cautious?
>
> Pete
> lcSQL Software <http://www.lcsql.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list