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