On Fri, Oct 30, 2015 at 3:33 AM, Richard Gaskin <[email protected]>
wrote:
>
> get lineoffset("foo", tText,"","text")
>
> Why wouldn't you make it work similar to matchText(), ie matchText returns
true or false regardless of whether you include a 'foundTextVarsList' but
if your regular expression contains parenthesis and you have a
foundTextVarsList then matchTextI() additionally populates variables for
you.
if matchText(tPhoneNos,"1-800 (.+)",tFreePhone) = true then
--the result is true then tFreePhone is populated
--the result is false then tFreePhone is empty
So why not make lineOffSet always return the line number, as it already
does, but include the text of the line if you add an optional parameter
variable to store it in?
get lineOffSet("foo",tText,3) -- returns the line number only
if lineOffSet("foo",tText,3,tTextOfFoundLine) > 55 then
--the result is > 0, tTextOfFoundLine is populated
--do something based on lines above 55
else
--the result is > 0, tTextOfFoundLine is populated
--do something base on lines 55 or less
end if
--the result is 0 then tTextOfFoundLine is empty
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode