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 Unique 4GL

Date:01/22/07
Author:ES
URL:n/a
Comments:0
Info:http://vismaunique.no
Score: (3.00 in 6 votes)
xtra="99_Beers"
on (@START)
  loop()
    if Bottles > 0
      if Bottles > 1
        assign(s = 's')
      else
        assign(s = '')
      endif
      assign(Outfield="Bottles"&' bottle'&&s1&& ' of beer on the wall, '&"Bottles"&' bottle'&&s1&&'
of beer. /,Take one down and pass it around,')
      if Bottles > 1
        if Bottles=2
          assign(s='')
        else
          assign(s='s')
        endif
        assign(Outfield = Outfield&&' '&("Bottles"-1))
      else
        assign(s = 's')
        assign(Outfield = Outfield&& ' no more')
      endif
      assign(Outfield = Outfield&& ' bottle'&&s1&&' of beer on the wall.')
    else
      assign(Outfield = 'No more bottles of beer on the wall, no more bottles of beer./,Go to the
store and buy some more, 99 bottles of beer on the wall.')
    endif
    decrement(bottles)
    print-form(BottleForm)
  until(Bottles = -1)
  endloop
endon

stream=OutputStream
  file-name('?')
  include-forms("BOTTLEFORM")

form="BOTTLEFORM"
  size(2.937,0)
  element="Outfield"
    type(OUTPUT)
    multi-line(ON)
    formatting(UNIQUE)
    connect("Outfield")
    position(0,1.25)
    size(2.75,76.375)

field=Outfield static() storage(A(255))
field=s        static() storage(A(1))
field=Bottles  static() storage(I4) initial(99)

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: