mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2021
Posts: 26
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2021
Posts: 26
I was hoping you could implement the following code to work:

Code
if (%does_not_exist isin $null $+ $false) { set %does_not_exist $false }

Even if you just use the following it does NOT work:

Code
if (%does_not_exist isin $null) { set %does_not_exist $true }

So my request is if you could make mIRC allow a non existant variable to be used like
Code
isin $null $+ $false

Thank you, good luck.

Joined: Jan 2012
Posts: 267
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2012
Posts: 267
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:
Code
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: /testVarValue


What 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).


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples

Link Copied to Clipboard