mIRC Home    About    Download    Register    News    Help

Print Thread
#255654 11/11/15 04:42 PM
Joined: May 2014
Posts: 36
P
Perl Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: May 2014
Posts: 36
hello, I make a loop to see if there is a variable, but I have tried several options and are unsuccessful.

Code:

        set %a 1
        while (%a <= 10) {
          set %sumavid variable $+ %a
          if (%sumavid == $null) { echo -s create | halt }
          else { echo -s dont create }
          inc %a
        }



It does not work


Code:
  set %a 1
        while (%a <= 10) {
          if (% $+ variable $+ %a == $null) { echo -s create | halt }
          else { echo -s dont create }
          inc %a
        }


either

an alternative to increase the variable name %var1 %var2 %var3 ... in while witch inc %a ,
would be different variables

Last edited by Perl; 11/11/15 04:58 PM.
Perl #255656 11/11/15 05:29 PM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try use this method:

Code:
alias test_if {
  var %a 1
  while (%a <= 10) {
    var %chk = %variable [ $+ [ %a ] ]
    if (!%chk) { echo -s create | halt }
    else { echo -s dont create }
    inc %a
  }
}


/help [ ] evaluation brackets


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #255658 11/11/15 06:47 PM
Joined: May 2014
Posts: 36
P
Perl Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: May 2014
Posts: 36

thanks, I have checked the brackets and has solved my problems, thanks and greetings.

Originally Posted By: westor
Try use this method:

Code:
alias test_if {
  var %a 1
  while (%a <= 10) {
    var %chk = %variable [ $+ [ %a ] ]
    if (!%chk) { echo -s create | halt }
    else { echo -s dont create }
    inc %a
  }
}


/help [ ] evaluation brackets


Link Copied to Clipboard