Language VDF
Date: | 07/01/05 |
Author: | A Paul Anthony |
URL: | n/a |
Comments: | 2 |
Info: | http://www.dataaccess.com |
Score: | ![]() |
Procedure mPrintBeer Integer iMax iCount iBottles String sCRLF sVerse Move 100 to iMax Move (character(13) + character(10)) to sCRLF For iCount from 0 to iMax Move (iMax - iCount) to iBottles Move (String(iBottles) * "Bottles of beer on the wall,"; * String(iBottles) * "bottles of beer." + sCRLF ; + "Take one down and pass it around,"; * if((iBottles = 1), "no", String(iBottles - 1)); * "bottle of beer on the wall." + sCRLF ) to sVerse ShowLn sVerse Loop Move ("No more bottle of beer on the wall."; * "No more bottles of beer..." + sCRLF; + "Go to the store and buy some more..."; * "99 bottles of beer.") to sVerse ShowLn sVerse End_Procedure
Download Source | Write Comment
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!
Comments
I'm now kicking myself with regards to starting the count at 100, not 99. The last verse should probably also use iMax as the suggested beer to buy quantity.
Oh, and the "1 bottles of beers" classic...