Check if global variable exists fails

You can check if a variable is defined this way:

  • Set !errorignore to true
  • use the variable, e. g. with store
  • Check the result with !LastCommandOK

Check if defined: (Since this is a global variable, it is defined at the second run of the macro, because we define it after the check!)

{
      "Name": "checkvar",
      "CreationDate": "2019-6-6",
      "Commands": [
        {
          "Command": "store",
          "Target": "true",
          "Value": "!errorignore"
        },
        {
          "Command": "store",
          "Target": "${globalvar5} ",
          "Value": "justatest"
        },
        {
          "Command": "if_v2",
          "Target": "${!lastcommandOK} == false",
          "Value": ""
        },
        {
          "Command": "store",
          "Target": "aaaaaaa",
          "Value": "globalvar5"  <=== now we define it!!!
        },
        {
          "Command": "else",
          "Target": "",
          "Value": ""
        },
        {
          "Command": "echo",
          "Target": "it was already defined",
          "Value": "green"
        },
        {
          "Command": "end",
          "Target": "",
          "Value": ""
        }
      ]
    }