Progressbar with text

Perc(pos, all)
{
  perc := Floor(pos*100//all)
  str = %perc%
  str .= "% ["
  lc := perc//10
  Loop %lc%
  {
    str .= "|"
  }
  Loop % (109-perc)//10
  {
    str .= "."
  }
  str .= "]"
  return str
}