Run this bit of code before reading my explanation:

Code:
alias1 {
  echo -a setting variables
  set %x test1
  set %y test2
  .timer 1 5 alias2
  .timer 1 10 alias3 %x %y
}

alias2 {
  echo -a changing variables
  set %x test3
  set %y test4
}

alias3 {
  echo -a var x: %x
  echo -a var y: %y
  echo -a para 1: $1
  echo -a para 2: $2
}


When you use %var1 and %var2 as parameters in the timer command, they will arrive in that alias as $1 and $2 respectively, representing the first and second parameters sent along (assuming for the moment neither variable contains any spaces).

However, I'm assuming that your new alias reads %var1 and %var2 again, which indeed have been updated. Use $1 and $2 to check the variables as they were when you initiated the timer.

EDIT: Also, if %x would be $null, then you'd get %y as $1, since that would become the first parameter.

Last edited by Thels; 10/09/10 10:23 AM.

Learning something new every day.