514

 Code:
function a($)
  Dim $b
  if $+0=$
    $b="no more",one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thir,four,fif,six,seven,eigh,nine,twen,thir,"for",fif,six,seven,eigh,nine
    if $<20
      $a=$b[$]
      if $>12
        $a=$a+teen
      endif
    else
      $a=$b[18+$/10]+ty
      if $ mod 10
        $a=$a + "-" + $b[$ mod 10]
      endif
    endif
    $a = $a + ' bottle' + IIf($ = 1, @, s) + ' of beer'
  else
    $ = 1 * $
    $b = ' on the wall'
    $a = chr(asc(a($))-32) + Right(a($), ~) + $b + ', ' + a($) + ". "
    If $
      $a = $a + 'Take one down and pass it around, ' + a($-1) + $b + "."
    Else
      $a = $a + 'Go to the store and buy some more, ' + a(99) + $b + "."
endfunction