[Solved] [Issue #408] How do I change a value in an array?

You are right - I see the issue now. To me, that looks like bug, and I made a ticket for it.

{
  "CreationDate": "2018-10-31",
  "Commands": [
    {
      "Command": "store",
      "Target": "fast",
      "Value": "!replayspeed"
    },
    {
      "Command": "open",
      "Target": "https://a9t9.com/kantu/demo/storeeval",
      "Value": ""
    },
    {
      "Command": "storeEval",
      "Target": "new Array ('cat','dog','fish','dog','??','frog','?','dog','??','horse','??elephant')",
      "Value": "names"
    },
    {
      "Command": "store",
      "Target": "2",
      "Value": "num"
    },
    {
      "Command": "storeEval",
      "Target": "storedVars['names'][${num}]",
      "Value": "myrandomname"
    },
    {
      "Command": "echo",
      "Target": "in array is ${myrandomname}",
      "Value": "blue"
    },
    {
      "Command": "storeEval",
      "Target": "storedVars['names'][${num}] = \"Hello World!\"",
      "Value": "notused"
    },
    {
      "Command": "storeEval",
      "Target": "storedVars['names'][${num}] ",
      "Value": "newname"
    },
    {
      "Command": "echo",
      "Target": "in array is now ${newname}",
      "Value": "green"
    }
  ]
}
1 Like