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 GUI4CLI

(V 19 for Windows)

Date:05/22/08
Author:Martin "Steyner" Tönnishoff
URL:n/a
Comments:0
Info:http://www.gui4cli.com
Score: (3.50 in 2 votes)
G4C BEERSONG

/* ===============================================================
	Description: Sing that beer beer song in GUI4CLI
	Language Home: www.gui4cli.com
	Author: Steyner 
	Email: toennishoff@liqui.net
	
=============================================================== */

WINDOW 893 16 300 200 "99 Bottles of Beer"
	WINATTR STYLE GRAY

XONLOAD
	GUIOPEN #this
	
	FOR x 1 99 			 //Cycle through the stanzas	
		y = $(100 - $x)
		IF $y = 2 
			s  = "s"
			ss = ""
		ELSEIF $y = 1
		   s  = ""
		   ss = "s"
		ELSE
		   s  = "s"
		   ss = "s"
		ENDIF
		
		USE EDBOX #this Output
		EDBOX ADD "$y bottle$s of beer on the wall,\r\n"
		EDBOX ADD "$y bottle$s of beer.\r\n"
		EDBOX ADD "Take one down and pass it around,\r\n"
		EDBOX ADD "$($y -1) bottle$ss of beer on the wall.\r\n\r\n"
		
   ENDFOR


XONCLOSE
	GUIQUIT #this

//	===============================================================
//	Visual Events
//	===============================================================

XEDBOX 10 10 280 180 $bl
	ATTR STYLE READONLY
	ATTR ID Output

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: