Retrieving an element in an array

Hi there team, I am trying to get the index of an element in a an array, I’m using the following but I’m getting an exception that “indexOf” is not declared:

myArray = {"tome","mary","lisa"}
targetElementIndex = indiexOf(myArray,"mary")

and i have set targetElementIndex to an int

  1. i also want to be able to do something like this:
nextTargetIndex = targetElementIndex + 1

thank you in advance!

grafik
Array.IndexOf(myArray,"mary")

1 Like

@olmccb
Please check indexOf spellling.

1 Like

Hi @olmccb, please try Array.IndexOf(myArray ,“mary”)

1 Like

ah see what i did wrong!! instead of starting the expresseion with “Array” i started with my array!! Thank you!

thank you for your hellp i see what i did wrong,i didnt start the expression with Array.

1 Like

thank you for your help!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.