Error getting tags :
error 404Error getting tags :
error 404 itemOffset | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
itemOffset
Basics
Expander triangle
Type
Function
Syntax
itemOffset(itemToFind,stringToSearch[,itemsToSkip])
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Returns the number of items between the beginning of a value and an occurrence of a specified string.
Examples

itemOffset("C","A,B,C,D,E") -- returns 3
itemOffset("C","A,B,C,D,E",2) -- returns 1
itemOffset("D,E","A,B,C,D,E") -- returns 4

Additional Comments
Expander triangle

Use the itemOffset function to find which item a string occurs in.

Parameters:

The itemToFind is a string or an expression that evaluates to a string.

The stringToSearch is a string or an expression that evaluates to a string.

The itemsToSkip is a non-negative integer. If you don't specify how many itemsToSkip, the itemOffset function does not skip any items.

Value:

The itemOffset function returns a non-negative integer.

Comments:

The value returned by the itemOffset function is the number of the item where itemToFind appears in stringToSearch. If the itemToFind is not in stringToSearch, the itemOffset function returns zero.

If the itemToFind contains more than one item, and the entire itemToFind appears in the stringToSearch, the itemOffset function returns the item number where the itemToFind starts.

If you specify how many itemsToSkip, the itemOffset function skips the specified number of items in the stringToSearch. The value returned is relative to this starting point instead of the beginning of the stringToSearch.

User Comments
Expander triangle
User thumbnail
stuart@runrev.com
StarStarStarStarStar
Nov 27, 2009
When using itemoffset remember to

set wholematches to true

if you only want items that completely match rather than contain itemToFind value.