Short snippet to limit a string's length. the idea is derrived from webpages which show the start of an article or phrase/etc.. this is the mIRC version
Usage
$truncate(N,T).ce
where the letters represent;
N - max length of string
T - text to limit
c - counts spaces as a character ($chr(32))
e - removes ellipsis from the end (the "..")
alias truncate {
if ($isid) {
if ($1 !isnum) { return 2* $truncate: incorrect paramater $+($qt($1),;) $truncate(maxlength,text) }
else { return $mid($2-,0,$iif(c isin $prop,$calc($1 + $numtok($mid($2-,0,$1),32)),$1)) $iif(e !isin $prop,$iif($len($2-) > $1,..)) }
}
else { echo -a 2* $!truncate: error; this alias can only be used as an identifier ($truncate form) }
}