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 OPL

Date:04/20/05
Author:Dave Wilson
URL:n/a
Comments:0
Info:n/a
Score: (3.00 in 21 votes)
OPL (Organiser Programming Language) is the language used by Psion palmtops.

REM ********************************************************************
REM *                        99 Bottles of Beer                        *
REM *                                                                  *
REM * A portable version for those who need this vital application     *
REM * with them at all times. The following is written in Psion OPL,   *
REM * the language used in the popular Series 3 and Series 3a palmtops *
REM * (and other previous Psion products).                             *
REM *                                                                  *
REM * by Dave Wilson, dawilson@brooktree.com                           *
REM *                                                                  *
REM ********************************************************************

PROC Main:
   LOCAL bottles%
   LOCAL bottle$(10)
   CLS
   bottles%=99
   bottle$=" bottles"
   PRINT "99 Bottles of Beer"
   PRINT
   WHILE(bottles% > 0)
      PRINT bottles%;bottle$;" of beer on the wall,"
      PRINT bottles%;bottle$;" of beer on the wall."
      PRINT "Take one down and pass it around,"
      bottles%=bottles%-1
      IF(bottles% = 1)
         bottle$=" bottle"
      ENDIF
      IF(bottles% <> 0)
         PRINT "There'll be ";bottles%;bottles$;" of beer on the wall."
      ELSE
         PRINT "There'll be no bottles of beer on the wall."
      ENDIF
      PRINT
   ENDWH
   PAUSE 0
ENDP

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: