Returns an integer byte position that locates the occurrence of a byte sequence within a sequence of octets(8-bit bytes).

The format of the $ZFIND function is:

$ZF[IND](expr1,expr2[,intexpr])
  • The first expression specifies the sequence of octets (8-bit bytes) in which $ZFIND() searches for the byte sequence.

  • The second expression specifies the byte sequence for which $ZFIND() searches.

  • The optional integer expression identifies the starting byte position for the $ZFIND() search. If this argument is missing, zero (0), or negative, $ZFIND() begins to search from the first position of the sequence of octets (8-bite bytes).

  • If $ZFIND() locates the byte sequence, it returns the position after its last byte. If the end of the byte sequence coincides with the end of the the sequence of octets (expr1), it returns an integer equal to the byte length of the expr1 plus one ($L(expr1)+1).

  • If $ZFIND() does not locate the byte sequence, it returns zero (0).

  • $ZFIND() provides a tool to locate byte sequences. The ( [ ) operator and the two-argument $ZLENGTH() are other tools that provide related functionality.

loading table of contents...