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 Visual DataFlex

Date:11/17/10
Author:Frank Cheng
URL:n/a
Comments:0
Info:http://www.visualdataflex.com
Score: (3.00 in 2 votes)
Use Windows

Function Bottles Global Integer iBottles Boolean bFirstWord Returns String
	Function_Return (If(iBottles,String(iBottles),If(bFirstWord,"No more","no more"))+If(iBottles=1,"
bottle"," bottles"))
End_Function

Procedure BottlesOfBear Integer iBottles
	Integer iTotal iVoid
	Move iBottles to iTotal
	While (iBottles>=0)
		Showln (Bottles(iBottles,TRUE)) " of beer on the wall, " (Bottles(iBottles,FALSE)) " of beer."
		Decrement iBottles
		If (iBottles<0) Showln "Go to the store and buy some more, " (Bottles(iTotal,FALSE)) " of beer on
the wall."
		Else Showln "Take one down and pass it around, " (Bottles(iBottles,FALSE)) " on the wall."
		Showln
	Loop
	Move (MessageBox(0,"Done","Info",0)) to iVoid
End_Procedure	

Send BottlesOfBear 99

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: