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

lineOffset("cheese",foodsList)
put subbedData into line (lineOffset(it,receivedData)) of receivedData

Additional Comments
Expander triangle

Use the lineOffset function to find which line a string occurs in.

Parameters:

The lineToFind 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 linesToSkip is a non-negative integer. If you don't specify how many linesToSkip, the lineOffset function does not skip any lines.

Value:

The lineOffset function returns a non-negative integer.

Comments:

The value returned by the lineOffset function is the number of the line where lineToFind appears in stringToSearch. If the lineToFind is not in stringToSearch, the lineOffset function returns zero. If the lineToFind is more than one line, the lineOffset function always returns zero, even if the lineToFind appears in the stringToSearch.

If you specify how many linesToSkip, the lineOffset function skips the specified number of lines 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
Paul Gabel
StarStarStarStarStar
May 15, 2010
Don't be confused by the line above "If the lineToFind is more than one line, the lineOffset function always returns zero." If several lines contain the lineToFind the lineOffset function will stop at the first line it finds and return that line number.