atnexti( ) Function

Description:
  The atnexti() function returns the offset within cDest of the nOccur occurrence of cSearch. If cSearch is not found, -1 is returned. The comparison is case insensitive. For a case sensitive search, see the atnext() function.  

Syntax:
  retval = atnexti( cSearch, cDest, nOccur )

Parameters:
  string: cSearch String to search for.
  string: cDest String to search in.
  numeric: nOccur Occurrence of string cSearch to look for.
  numeric: retval The offset in cDest of the occurrence nOccur of cSearch or -1 if not found.

Platforms:
  Windows, DOS, Internet Active Pages



Example:

	local var1, var2, var3, retval                         	// Variables						
	var1 = ( "abcabcabcabc")				// Search Array
	var2 = prompt( "Pick a letter a, b or c", "", 2 )	// Character to search for 
	var3 = prompt( "Pick a number from 1 to 4", "", 2 )	// Occurance to search for
	retval = atnexti( var2, var1, var3 )
	
	retval = retval +1					// To start from 1 instead of 0	
	println( "In this String (" + var1 + ") " )
	println( "You picked the letter (" + var2 + ")" )
	println( "And the " + var3 + " occurance of it" )
	println( "Which means you picked the " + retval + " character in the string." )

  

(c) 2000-2001 by West Coast Web Adventures, Inc., All Rights Reserved