Zandor said:
Nov 3rd, 2010, 10:06pm
alias colorful {
var %r
07
02
03
10
12
04
06
13,%l 1,%b 1,%x
while (%l <= $len($1-)) {
if ($mid($1-,%l,1) == $chr(32)) { %x = %x $+ $gettok(%r,%b,32) $+ $chr(32) $+ $ifmatch }
else { %x = %x $+ $gettok(%r,%b,32) $+ $mid($1-,%l,1) }
%b = $iif(%b == 8,1,$calc(%b + 1))
inc %l
}
return %x
}
alias red {
var %r
07
04,%l 1,%b 1,%x
while (%l <= $len($1-)) {
;if (($mid($1-,%l,1) == $chr(32)) || ($mid($1-,%l,1) isnum)) { %x = %x $+ $gettok(%r,%b,32) $+ $chr(32) $+ $ifmatch }
if ($mid($1-,%l,1) == $chr(32)) { %x = %x $+ $gettok(%r,%b,32) $+ $chr(32) $+ $ifmatch }
else { %x = %x $+ $gettok(%r,%b,32) $+ $mid($1-,%l,1) }
%b = $iif(%b == 5,1,$calc(%b + 1))
inc %l
}
return %x
}
alias xms {
var %r
03
04,%l 1,%b 1,%x
while (%l <= $len($1-)) {
;if (($mid($1-,%l,1) == $chr(32)) || ($mid($1-,%l,1) isnum)) { %x = %x $+ $gettok(%r,%b,32) $+ $chr(32) $+ $ifmatch }
if ($mid($1-,%l,1) == $chr(32)) { %x = %x $+ $gettok(%r,%b,32) $+ $chr(32) $+ $ifmatch }
else { %x = %x $+ $gettok(%r,%b,32) $+ $mid($1-,%l,1) }
%b = $iif(%b == 2,1,$calc(%b + 1))
inc %l
}
return %x
}
alias xms1 { msg # $xms($1-) }