Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language Word

Date:04/20/05
Author:Mark Pilgrim
URL:n/a
Comments:0
Info:n/a
Score: (2.59 in 17 votes)
Sub MAIN
REM "99 bottles of beer on the wall"
REM Microsoft Word WordBasic macro language version
REM written by Mark Pilgrim, f8dy@netaxs.com
FileNew
beer$ = "99"
bottle$ = " bottles "
For  count = 99 To 1 Step - 1
  Insert beer$ + bottle$ + "of beer on the wall,"
  InsertPara
  Insert beer$ + bottle$ + "of beer,"
  InsertPara
  Insert "Take "
  If count > 1 Then
    Insert "one"
  Else
    Insert "it"
  End If
  Insert " down, pass it around,"
  InsertPara
  If count > 1 Then
    beer$ = Str$(count - 1)
    beer$ = Right$(beer$, Len(beer$) - 1)
    If count = 2 Then bottle$ = " bottle "
    Insert beer$ + bottle$ + "of beer on the wall."
    InsertPara
  Else
    Insert "No more bottles of beer on the wall."
  End If
  InsertPara
Next
End Sub

Download Source | Write Comment

Alternative Versions

Comments

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: