Using "offset"

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

Using "offset"

Post by bjb007 » Wed Jul 30, 2008 3:38 pm

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.
Life is just a bowl of cherries.

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Wed Jul 30, 2008 4:05 pm

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?

bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

Using "offset"

Post by bjb007 » Wed Jul 30, 2008 8:27 pm

Thanks SpartOut.

Missed that.
Life is just a bowl of cherries.

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Wed Jul 30, 2008 9:27 pm

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.

Post Reply