mIRC Home    About    Download    Register    News    Help

Print Thread
#205059 11/10/08 06:56 AM
Joined: Oct 2008
Posts: 3
S
s3b Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Oct 2008
Posts: 3
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
  }
}

Joined: Jul 2006
Posts: 4,146
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,146
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.




#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard