Page 1 of 1

Using "offset"

Posted: Wed Jul 30, 2008 3:38 pm
by bjb007
The "offset" function returns a non-negative
integer indicating the location of the found
string.

What does it return if the string searched
for isn't found in the "stringToSearch"?

Could it be zero? The docs don't say.

Posted: Wed Jul 30, 2008 4:05 pm
by SparkOut
That's odd. On my copy
Revolution Documentation -> Dictionary on my edition (Studio 2.9 for Windows) wrote:Value:
The offset function returns a non-negative integer.

Comments:
The value returned by the offset function is the number of the character where charsToFind appears in stringToSearch. If the charsToFind is not in stringToSearch, the offset function returns zero.
There's a similar comment on each of the line and word etc. Offset entries in my docs. What version do you have?

Using "offset"

Posted: Wed Jul 30, 2008 8:27 pm
by bjb007
Thanks SpartOut.

Missed that.

Posted: Wed Jul 30, 2008 9:27 pm
by SparkOut
Ah, right, no problem. :)
I was a bit conscious it might mean there's a docs issue that meant some docs or even features get "adjusted" in v. 3.0 beta.