mIRC Home    About    Download    Register    News    Help

Print Thread
#48126 08/09/03 11:55 PM
Joined: Sep 2003
Posts: 11
A
Pikka bird
OP Offline
Pikka bird
A
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?
#48127 09/09/03 12:24 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
This does appear to be a bug:
//echo -a $+($anynullidentifier,$iif(1,1))

#48128 09/09/03 12:40 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
In the meantime:
Code:
alias ac.style1 {
  var %string = $1-,%a = $len(%string),%b = 1
  while (%b &lt;= %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
}

#48129 09/09/03 01:18 AM
Joined: Sep 2003
Posts: 11
A
Pikka bird
OP Offline
Pikka bird
A
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?
#48130 09/09/03 01:26 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
It works for me in 6.1.

#48131 12/09/03 07:48 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
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.
Code:
$+($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:
Code:
alias ac.style1 {
  var %string = $1-, %a = $len(%string), %b = 0, %c = 11,01
  while (%b &lt; %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
#48132 12/09/03 10:24 PM
Joined: Sep 2003
Posts: 11
A
Pikka bird
OP Offline
Pikka bird
A
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?
#48133 13/09/03 10:30 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
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

Link Copied to Clipboard