Change variable from one array to another

Hi,

Let’s say I have this :

table1 = #(“a”, “b”, “c”)
table2 = #(“x”, “y”, “z”)

now I have var = “b”

  1. how can I check if var is in table1 ? without for loop in entire array (my arrays are way more large)
  2. if var is in table1, how can I get the same index item from table2 ?

Easy for you I guess, but I’mmore fluent with python lol :slight_smile:

findItem <array> <value>
Does a MAXScript ‘==’ comparison between elements in the array and the target object and then returns the index of the first occurrence of the given value in the array or 0 (zero) if the value is not in the array.
Values such as Point3s and Strings match if they have the same contents.

not sure if its faster than a loop :confused:

Many thanks, it does the trick perfectly !!