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 VGL

(This is an update to a previous post)

Date:07/03/08
Author:Joel Limardo
URL:http://www.limsexpert.com
Comments:0
Info:http://www.thermo.com/com/cda/product/detail/1,,10379,00.html
Score: (2.67 in 3 votes)
ENABLE WINDOWS
SET NAME "DISPLAY/"
SET FORMAT "99"

DECLARE indx, stockMsg, outMsg

stockMsg = "Take one down, pass it around,"
indx = 99
outMsg = ""

WHILE (indx > 0) DO
   outMsg = drink(indx)
LITERAL
$outMsg___________ on the wall, $outMsg_______________!
Take one down, pass it around,
$ENDLITERAL
  
   outMsg = drink(indx - 1)

LITERAL
$outMsg___________ on the wall!

$ENDLITERAL
   indx = indx - 1

ENDWHILE
{---------------------------------------------}
ROUTINE drink (VALUE n)
  DECLARE drunkMsg
  
  drunkMsg = STRING(n) : " bottles of beer"
  IF (n = 0) THEN
     drunkMsg = "No more bottles of beer"
  ELSEIF (n = 1) THEN
     drunkMsg = drunkMsg # "s"
  ENDIF
  RETURN(drunkMsg)
ENDROUTINE

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
1Anonymous04/20/051

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: