I don't quite understand why you need this, what you want to do, what is the end goal and what should be the result. But it looks like you are doing something wrong.
You can learn how such conditions work in the example below:
alias testVarValue {
if (!%does_not_exist) { set %does_not_exist $null | echo test1: %does_not_exist (Null) }
if (%does_not_exist == $null) { set %does_not_exist $false | echo test2: %does_not_exist (False) }
if (%does_not_exist == $false) { set %does_not_exist $true | echo test3: %does_not_exist (True) }
if (%does_not_exist == $true) { unset %does_not_exist | echo test4: %does_not_exist (Variable deleted) }
}
To test, enter the command:
/testVarValueWhat checks each condition:
if (!%does_not_exist)
- if a variable with that name does not exist, it will be created with an empty value = "$null" — (More here).if (%does_not_exist == $null)
- if the variable exists and it is empty = "$null", then it is assigned the value "$false" — (More here).if (%does_not_exist == $false)
- if the variable has the value "$false", then it is assigned the value "$true" — (More here).if (%does_not_exist == $true)
- if the variable has the value "$true", then it is deleted — (More here).
Or so:
if (!%does_not_exist)
- used when you want to check that this variable does NOT exist.if (%does_not_exist)
- used when you want to check that this variable does exist.
Perhaps this is how you want to check your variables, but in fact, it can be done in many ways — (
More here).