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 Active FoxPro Pages

(Initial sample)

Date:12/11/06
Author:Jochen Kirstätter
URL:http://www.prolib.de
Comments:0
Info:http://www.afpages.de
Score: (3.00 in 5 votes)
<html>
<head>
<title>99 Bottles of beer - Active FoxPro Pages</title>
<head>
<body>
<%
*---		Active FoxPro Pages (AFP) - ProLib Software GmbH, Germany
*---		Listing by Jochen Kirstätter <jochenk@prolib.de>
*---		(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("<br/>" + m.lcContent + " on the wall, ")
		Response.Write(m.lcContent + ".")
		Response.Write("<br/>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.<br/>")
	EndFor
	Response.Write("<br/>N" + Substr(m.lcContent,2) + " on the wall, " + m.lcContent + ".")
	Response.Write("<br/>Go to the store and buy some more, " + Transform(m.lnCount) + " bottles of
beer on the wall.")
%>
</body>
</html>

Download Source | Write Comment

Alternative Versions

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: