<%
*--- Active FoxPro Pages (AFP) - ProLib Software GmbH, Germany
*--- Listing by Jochen Kirstätter
*--- (simple version - at http://www.afpages.de/ is an object-oriented version)
Local lnCount, lnIndex, lcContent, lcSuffix
m.lnCount = 99
For m.lnIndex = m.lnCount To 1 Step -1
If Not m.lnIndex == 1
m.lcSuffix = "s"
EndIf
m.lcContent = Transform(m.lnIndex) + " bottle" + m.lcSuffix + " of beer"
Response.Write("
" + m.lcContent + " on the wall, ")
Response.Write(m.lcContent + ".")
Response.Write("
Take one down and pass it around, ")
If m.lnIndex - 1 > 0
If m.lnIndex - 1 == 1
m.lcSuffix = ""
EndIf
m.lcContent = Transform(m.lnIndex - 1) + " bottle" + m.lcSuffix + " of beer"
Else
m.lcContent = "no more bottles of beer"
EndIf
Response.Write(m.lcContent + " on the wall.
")
EndFor
Response.Write("
N" + Substr(m.lcContent,2) + " on the wall, " + m.lcContent + ".")
Response.Write("
Go to the store and buy some more, " + Transform(m.lnCount) + " bottles of beer on the wall.")
%>