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 HotBasic

(GUI Version)

Date:10/04/05
Author:AirrSongs
URL:http://www.airsys.com
Comments:0
Info:http://www.hotbasic.org
Score: (2.50 in 28 votes)
'--------------------------------
' 99-Bottles
' GUI Version
' 
' Coded By:  AirrSongs - www.airsys.org
' Language: HotBasic - www.hotbasic.org
' Date: 10/03/05' 
'--------------------------------


$apptype gui:$typecheck on

declare Function Get_Bottles(num as byte) as string

create form1 as form
	width=300
	height=350
	minimizebox=false
	maximizebox=false
	center
	onshow=Count_Bottles
	create list1 as listbox
		top=0
		left=0
		width=form1.clientwidth
		height=form1.clientheight
	end create
end create

form1.showmodal
end

Function Get_Bottles(num as byte) as string
	defstr Ret
		select case num
			case 0: Ret = "No more bottles of beer"
			case 1: Ret = "1 bottle of beer"
			case else: Ret = str$(num) + " bottles of beer"
		end select
	result = Ret
end Function

Count_Bottles:
	defbyte i =99
		do
			list1.additems(Get_Bottles(i) + " on the wall, " 
			list1.additems(Get_Bottles(i) + ",")
			list1.additems("take one down, pass it around,")
			list1.additems(Get_Bottles(i-1) + " on the wall.")
			list1.additems(NULL)
			dec(i)
		loop until i = 0
return

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
Different,using a Do-Loop & Select/CaseAirrSongs10/02/051
2Joe B.04/20/051

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: