mIRC Homepage
Posted By: hatten set many variables - 24/02/04 11:42 AM
ok i have asked quite a few question the last few days smile but hopefully someone else also can make use of the top notch replies ive been getting. i have a part in a script which looks like this ;

set %variable10 %variable9
set %variable9 %variable8
set %variable8 %variable7
set %variable7 %variable6
set %variable6 %variable5
set %variable5 %variable4
set %variable4 %variable3
set %variable3 %variable2
set %variable2 %variable1

i wonder if this is the most efficient and fastest way to set these 10 variables ?
Posted By: tidy_trax Re: set many variables - 24/02/04 11:49 AM
alias setvars {
var %i 10
while $calc(%i - 1) {
set %variable [ $+ [ %i ] ] %variable [ $+ [ $calc(%i -1) ] ]
dec %i
}
}
Posted By: DaveC Re: set many variables - 24/02/04 12:55 PM
you should have started at 9 and added one, then u could just test while %i
Posted By: Man Re: set many variables - 24/02/04 01:14 PM
What are you trying to do, I have a small idea of why you might be setting all those variables (you have some que or something). If this is the case a hidden list window will do the job alot better, and if you need to its easy to visualise the que.

If not, why else are you setting all these variables like this?
Posted By: hatten Re: set many variables - 24/02/04 01:15 PM
not sure if i get that (dave c) smile
Posted By: Iori Re: set many variables - 24/02/04 09:11 PM
Code:
alias set.vars {
  var %i = 9
  while %i {
    set %variable $+ $calc(%i +1)  $($+(%,variable,%i),2)
    dec %i
  }
}
Posted By: DaveC Re: set many variables - 24/02/04 10:23 PM
hidden windows wont last through a mirc shutdown/crash varaibles well
Posted By: Man Re: set many variables - 25/02/04 07:02 AM
But for most ques that doesnt matter. Thats why I asked what the variables were being used for.
© mIRC Discussion Forums