`<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
@ECHO OFF
:: BEER.BTM - 4DOS version 5.5 batch (btm) file
:: by Rodney M. Savard <rodney.savard%phun@phunnet.org>
SETLOCAL
SET plural=`s`
DO bottle = 99 TO 1 BY -1
ECHOS %bottle% bottle%plural% of beer on the wall,
ECHO %bottle% bottle%plural% of beer.
ECHOS Take one down, pass it around,
IFF (%@EVAL[%bottle% - 1]) == (0) THEN
ECHO no more bottles of beer on the wall.
ELSE
IF (%@EVAL[%bottle% - 1]) == (1) UNSET plural
ECHO %@EVAL[%bottle% - 1] bottle%plural% of beer on the wall.
ECHO.
ENDIFF
ENDDO
ENDLOCAL
4Test is the language used for GUI testing by Segue Software's QA Partner.
// 4Test Version of 99 Bottles of beer
//
// Eric DeCosta
//
testcase bottles()
INTEGER bottles
for (bottles = 99; bottles >0;)
print("{bottles} bottle(s) of beer on the wall,")
print("{bottles} bottle(s) of beer.")
print("Take one down, pass it around,")
print("{--bottles} bottle(s) of beer on the wall.")