mIRC Homepage
Posted By: s3b strange script evaluation - 11/10/08 06:56 AM
The function (not identifier, lets get this shit right, it's a function) $read evaluates one too many times. For example, I have written a function to echo the filename and contents of each script loaded. If any of your scripts use a $identifier or %identifier these will be evaluated on output rather than the name of the $identifier/%identifier. This is extremely awkward for a scripting/programming language. Get your shit together, man.

Code:
alias ScriptStuff {
  var %a
  var %b
  var %l
  var %s
  var %x
  var %y = $script(0)
  echo -- scripts loaded: %y

  %x = 1
  while (%x <= %y) {
    %s = $script(%x)
    %b = $lines(%s)
    %a = 1
    echo $+(script[,%x,]) = %s
    echo ----------
    while (%a < %b) {
      echo $+(line[,%a,]) = $read(%s,%a)
      inc %a
    }
    echo ----------
    inc %x
  }
}
Posted By: Wims Re: strange script evaluation - 11/10/08 07:08 AM
Did you even read the help file about $read ?

Originally Posted By: /help $read
If the n switch is specified then the line read in will not be evaluated and will be treated as plain text.


© mIRC Discussion Forums