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 4D

Date:04/20/05
Author:Anonymous
URL:n/a
Comments:2
Info:n/a
Score: (2.52 in 23 votes)
  `<A HREF="http://www.4d.com">4th Dimension</A> is a
  ` RDBMS development environment
  `available for Macintosh and Windows.

  ` 4D version of 99 bottles of bottels of beer on the wall
  ` 2003 (john.windberg@dwdev.com)

ON ERR CALL("")
C_STRING(1;$s)
C_INTEGER($beers;$tickCount;$delay)
$delay:=100
$s:="s";

For ($beers;4;0;-1)
MESSAGE(String($beers)+" bottle"+$s+" of beer on the
wall, ")
$tickCount:=Tickcount
While (Tickcount<($tickCount+$delay))
DELAY PROCESS(Current process;1)
End while 

MESSAGE(String($beers)+" bottle"+$s+" of beer, ")
$tickCount:=Tickcount
While (Tickcount<($tickCount+$delay))
DELAY PROCESS(Current process;1)
End while 

If ($beers=0)

MESSAGE("Go to the store, buy some more, ")
$tickCount:=Tickcount
While (Tickcount<($tickCount+$delay))
DELAY PROCESS(Current process;1)
End while 

MESSAGE("99 bottles of beer on the wall.")
$tickCount:=Tickcount
While (Tickcount<($tickCount+$delay))
DELAY PROCESS(Current process;1)
End while 

Else 
MESSAGE("Take one down, pass it around, ")
$tickCount:=Tickcount
While (Tickcount<($tickCount+$delay))
DELAY PROCESS(Current process;1)
End while 

If ($beers=2)
$s:=""
Else 
$s:="s"
End if 

MESSAGE(String($beers-1)+" bottle"+$s+" of beer on the
wall.")
$tickCount:=Tickcount
While (Tickcount<($tickCount+$delay))
DELAY PROCESS(Current process;1)
End while 

End if 

End for

Download Source | Write Comment

Alternative Versions

Comments

>>  sig said on 07/24/06 21:35:44

sig XP - what a language :P

>>  Jim Boyd said on 03/20/08 20:21:02

Jim Boyd If I wrote in 4D I would be Anonymous too.

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: