mIRC Home    About    Download    Register    News    Help

Print Thread
#141968 14/02/06 06:06 PM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I'm setting some variables so that I can address each line in an edit box to use later. I have this code.
Code:
on *:dialog:mail:sclick:6:{
  sockopen sendmail ServerName 25
  var %N = 1
  set %bodylen $did(mail,7).lines
  while (%N <= $did(mail,7).lines) {
    set % $+ %N $did(mail,7,%N).text
    inc %N
  }
}

and this bit of code in a socket event.
Code:
var %C = 1
  while (%C <= %bodylen) {
    sockwrite -n $sockname % $+ %C
    inc %C
  }

In the first segment of code, my variables are getting set how I thought they would be. It looks like this:
%1 Hey,
%2
%3 This is a multi-line email.
%4
%5 You should get several lines.
%6
%7 THE END
But the email it is sending is just the right amount of lines, only just the variable names, like %1 %2 etc. Any ideas? Thanks.

#141969 14/02/06 06:19 PM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I fixed my problem. Here's the fix:
Code:
var %C = 1
  while (%C <= %bodylen) {
    sockwrite -n $sockname $eval(% $+ $eval(%C,1),2) 
    inc %C
  }

#141970 14/02/06 06:32 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
No need to evaluate the variable '%c' since it will be evaluated right away.

Code:
 $eval(% $+ %C,2)  


You could also just use '$()' which is the same as $eval.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!

Link Copied to Clipboard