xDaeMoN commented on a Page, $bar  -  Jun 27, 2007

You can still shorten this & get rid of the while loop and the long last line.

Here\'s what I came up:

alias bar {
  var %l = 20, %c = $calc($2 / $1), %d = $int($calc(%l * %c)), %p = $calc(%c * 100) $+ %, %ps = $int($calc($len(%p) / 2))
  var %bar = $str($chr(160),%l), %p1 = $calc((%l / 2) - %ps), %p2 = $calc((%l / 2) - %ps + $len(%p))
  %bar = $mid(%bar,1,%p1) $+ %p $+ $mid(%bar,%p2,$calc(%l - %p2))
  return 12,08 $+ $left(%bar,%d) $+ 08,12 $+ $right(%bar,$calc(%l - %d)) $+  $3-
}

Same usage: $bar(C,N,text)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.