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

(SampleManager post 3.2 version)

Date:03/31/06
Author:Joel Limardo
URL:http://www.limsexpert.com
Comments:1
Info:http://www.thermo.com/com/cda/product/detail/1,,10379,00.html
Score: (3.08 in 13 votes)
ROUTINE drink (VALUE n)
  DECLARE drunkMsg
  drunkMsg = STRIP(STRING(n)) : " bottles of beer"
  IF (n = 0) THEN
     drunkMsg = "No more bottles"
  ELSEIF (n = 1) THEN
     drunkMsg = drunkMsg # "s"
  ENDIF
  RETURN(drunkMsg)
ENDROUTINE

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

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
This is an update to a previous postJoel Limardo07/03/080
2Anonymous04/20/050

Comments

>>  Joel Limardo said on 04/04/06 21:09:46

Joel Limardo Actually I should have called this the "post 2.6" version since 3.2, a VMS-based version of SampleManager, actually used that pound sign syntax for subtracting one string from another. I don't think anything before 3.2 could do that. Also, I meant to use that stockMsg variable, but forgot about it in the rush.

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: