Language Clarion
(Data Centric language)
| Date: | 07/26/06 |
| Author: | Bruce Barrington? |
| URL: | n/a |
| Comments: | 1 |
| Info: | http://www.softvelocity.com |
| Score: |
RealBeer Program
Include('Equates')
Map. !Ask Clarion to include it's own functions.
BigStr cstring(8192)
part1 string(' bottles of beer on the wall, ')
part2 string(' bottles of beer, take one down and pass it around, ')
part3 string(' bottles of beer,')
i byte
last1 string(' bottle of beer on the wall, ')
last2 string(' bottle of beer, take one down and pass it around, ')
last3 string(' No more bottles of beer.')
cf equate('<13,10>')
!-----------------------------------------------------------------
!The code below will create a window for the text to be displayed.
!-----------------------------------------------------------------
Window WINDOW('Beer on the Wall.'),AT(,,246,164),GRAY,RESIZE,SYSTEM
TEXT,AT(0,0),USE(BigStr),FULL,COLOR(COLOR:Blue)
END
!---------------------
!Start of main section.
!---------------------
CODE
open(window)
accept
case event()
of event:openwindow
do loadbeer
end
end
!-------------------------------------------
! Populate the textbox for display
!-------------------------------------------
LoadBeer Routine
loop i = 99 to 1 by -1
if i = 1
BigStr = BigStr & i & part1 & i & part2 & part3
else
BigStr = BigStr & i & part1 & i & part2 & i-1 & part3 & cf
.
.
Download Source | Write Comment
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!
Comments
if i = 1
BigStr = BigStr & i & last1 & i & last2 & last3
ie. use the last vars not the part vars