Hi,
Hopefully this is simple.
If I have an array: testarray = ["bob", "fred", "ted", "Paul"]
I want to know the position in the array of "ted" (in this case its 2)
Is there a simple function that can give me that?
e.g. json.index(testarray , "ted"]
Of course I know json.index does not exist.
I know there are longer ways to do this (count through the array until I find "ted", but I thought there might be a function)?
Thanks
Getting item index from json array
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: Getting item index from json array
I would bookmark this page of all the MapTool functions, https://wiki.rptools.info/index.php/Cat ... o_Function
What you're looking for is Wiki: json.indexOf().
What you're looking for is Wiki: json.indexOf().
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools