Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

INDEX

Description

The INDEX function will return the position of a character or characters within another string. It takes the general form: 

INDEX(expression1, expression2, expression3)

Where:

  • expression1 evaluates to the string to be searched.
  • expression2 evaluates to the string or character that will be searched for within expression1.
  • expression3 should evaluate to an integer value and specify which occurrence of expression2 should be searched for within expression1.


Note: 

If the specified occurrence of expression2 is not found in expression1 then it returns Zero (0). 

An example of use is as: 

ALPHBT = "abcdefghijklmnopqrstuvwxyzabc"
CRT INDEX(ALPHBT , "a", 1)
CRT INDEX(ALPHBT , "a", 2)
CRT INDEX(ALPHBT, "jkl", 1)

to display:

1
27
10


Go back to jBASE BASIC

Was this article helpful?