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 ASP

Date:04/20/05
Author:Anonymous
URL:n/a
Comments:4
Info:n/a
Score: (2.93 in 197 votes)
Microsoft's Active Server Pages language (called VBScript), meant to be embedded in HTML documents.
<HTML>
<HEAD>
<TITLE>99 Bottles of Beer</TITLE>
</HEAD>
<BODY>
<!-- Microsoft ASP (Active Server Pages) listing by Vince Curley
(vincec@microsoft.com) -->
<%
	n = 99
	do
		str = n & " bottle"
		if n <> 1 then str = str & "s"
		str = str & " of beer"
		Response.Write str & " on the wall...<BR>"
		Response.Write str & "!<BR>"
		Response.Write "Take one down, pass it around...<BR>"
		n = n - 1
		if n > 0 then
			str = n
		else
			str = "No "
		end if
		str = str & " bottle"
		if n <> 1 then str = str & "s"
		str = str & " of beer on the wall!<BR>"
		Response.Write str
		Response.Write "<BR>"
	loop while n > 0
	Response.Write "<FONT SIZE=7><STRONG>Buy more
beer!</STRONG></FONT>"
%>
</BODY>
</HTML>

Download Source | Write Comment

Alternative Versions

Comments

>>  J said on 04/17/07 06:49:38

J ASP all the way!

>>  Mog said on 05/25/07 23:06:05

Mog Won't work with that line break in "Buy more beer!" because VBScript is stupid...

>>  Johan said on 04/17/08 11:48:51

Johan If it's asp 3.0 it will most definatley work

>>  Miraš Baran Satic said on 10/27/09 19:08:23

Miraš Baran Satic Unfortunately for beginners, but a good dead language no longer :)

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: