|
Joined: Sep 2003
Posts: 11
Pikka bird
|
OP
Pikka bird
Joined: Sep 2003
Posts: 11 |
i was making a stuff to make a string colorfull (each leter of a color (11 or 12) ) but the returing string (colored one) aways come with a $null before it! here is the code: alias ac.style1 { var %string = $1-,%a = $len(%string),%b = 1 while (%b <= %a) { var %x = $iif(%x,0,1),%c = $+($iif(%c,%c),,$iif(%x,11,12),$right($left(%string,%b),1),$chr(32), )) | inc %b } return 00,01 $+ %c }
the $iif(%c,%c) part is a unsussecfull (did i wrote it right?) trying to make the $null go away... if it is my scripting, help me to make it work ok! (i'm brazilian, don't blame my english)
Why do I still go to school if the destiny is death?
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
This does appear to be a bug: //echo -a $+($anynullidentifier,$iif(1,1))
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
In the meantime: alias ac.style1 {
var %string = $1-,%a = $len(%string),%b = 1
while (%b <= %a) {
var %x = $iif(%x,0,1),%c = %c $+ $+(,$iif(%x,11,12),$right($left(%string,%b),1),$chr(32), ))
inc %b
}
return 00,01 $+ %c
}
|
|
|
|
Joined: Sep 2003
Posts: 11
Pikka bird
|
OP
Pikka bird
Joined: Sep 2003
Posts: 11 |
this code didn't work too (mIRC 6.10)
Why do I still go to school if the destiny is death?
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
Yeah, it seems that if you use $null (or anything that returns $null) as a $+() parameter and $iif() as another (after than the $null one), "$null" will appear sometimes (look at the 3rd example). It's behaviour is weird. $+($null, blah) = blah
$+($null, blah,$iif(1,$null)) = $nullblah
$+($iif(1,$null),blah,$null) = blah
$+(blah,$null,$iif(1,$null), bleh,$null,$null) = blah$nullbleh
$+(blah,$null,$iif(1,$null), bleh,$null,$iif(2,$null)) = blah$null$nullbleh$null For now, just avoid using $iif() in $+(). I attempted to make your code work and there it is.. I hope you don't mind I've improved it a little: alias ac.style1 {
var %string = $1-, %a = $len(%string), %b = 0, %c = 11,01
while (%b < %a) {
inc %b
var %x = $iif(%x == 12,11,12), %c = $+(%c,$mid(%string,%b,1),,%x,$chr(32))
}
return $left(%c,-3)
} P.S.: Desculpa pelo reply em inglês, não sei se reclamariam por eu responder em português..
Last edited by cold; 12/09/03 08:31 AM.
* cold edits his posts 24/7
|
|
|
|
Joined: Sep 2003
Posts: 11
Pikka bird
|
OP
Pikka bird
Joined: Sep 2003
Posts: 11 |
1st time posting here so i don't know how to use this forum system.. thx cold I didn't saw that possibility =p (i was changing it to use $1 and $2 as the two colors and $3 as the background color)
damn my english sucks! hehehe...
P.S.: Valeu mermo cara, odeio postar em inglês =p (e 00,01 pois a 1ª letra pode ser um número)
Why do I still go to school if the destiny is death?
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
I suggest you to read my post again if you read it only as an email, because I edited it a lot.. my bad :tongue:
* cold edits his posts 24/7
|
|
|
|
|