Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    How do I get the index number of an item in an array?

    Help
    2
    2
    350
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      PosingSaucer251 last edited by

      I never would've thought I would be in the help section, but here I am, Is there a way to get the index number of an array? I know how to do it the "long way" with my own function and everything, but most programming languages have something like that . I know there are tons of secrets that are not on the help section such as getting the letter at a specific index inside a string (string[index]), so I am wondering if there is something like that on fuze too.

      1 Reply Last reply Reply Quote 3
      • mozipha
        mozipha last edited by

        I'm not aware of any built-in way to do that. For most array processing functions, if you want them, it's up to you to code them.

        It's not directly related to your question, but one trick I've found that can be useful in some circumstances, particularly when dealing with structs, is to convert the array/struct into a string using str() and then process it with the string functions. It's particularly relevant to structs because it allows you to search for a field within the struct, which can't normally be done. The limitation on this, though, is that str() will throw an error if the struct contains anything such as a handle that can't be converted to a string.

        1 Reply Last reply Reply Quote 3
        • First post
          Last post