So, I'm finally trying to learn the v2 syntax by converting one of my v1 scripts.
Below is an example of an array, the way I've formatted it in v1:
Code: Select all
MyArray := []
MyArray[1] := "MyText1"
MyArray[2] := "MyText2"
MyArray[3] := "MyText3"
If I require a specific value to be assigned to a specific index within the array, what is the new way to achieve this?
I think the code I have below will work -- but I would like to know if this is the recommended way going forward, or are there still alternative ways to do this like the code above?
Code: Select all
MyArray := []
MyArray.InsertAt(1, "MyText1")
MyArray.InsertAt(2, "MyText2")
MyArray.InsertAt(3, "MyText3")
Code: Select all
MyArr := Map()
MyArr[1] := "MyText1"
MyArr[2] := "MyText2"
MyArr[3] := "MyText3"