Contents | Index | < Browse | Browse >


  SEARCHVAR  Variable String CI|CS FIRST|NEXT


  This command will search a variable for a string.

  Variable	is the variable you want to search
  String	is the string you are looking for
  CI or CS	means Case-Sensitive (CI) or Case-Insensitive (CI)
  FIRST|NEXT	is used to let you find multiple occurances of
		the string you're looking (see below)

  The result, if found, can be read from  internal variables .

  Example :

  x = 'That is a test string'
  SearchVar x "is" CI FIRST
     ; now $$Search.pos will = 5 which is the character that "is"
     ; starts at
  pos = $$Search.pos
  say "$x[$pos]n"
     ; will print out : "is a test string"
  SearchVar x is CI NEXT
     ; now $$Search.pos will = "" (nothing) because there are no more
     ; occurances of the word "is" in variable x.