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 SAL

Date:05/28/08
Author:bbfh
URL:n/a
Comments:0
Info:n/a
Score: (2.88 in 8 votes)
Application description: Lyrics of the song 99 Bottles of Beer
  Libraries
  Global Declarations
    Window Defaults
    Formats
    External Functions
    Constants
      System
      User
        String: CRLF	= '
        '
    Resources
    Variables
    Internal Functions
      Function: gfBottle
        Description:
        Returns
          String:
        Parameters
          Number: p_nCount
        Static Variables
        Local variables
        Actions
          If p_nCount >= 1
            Return SalNumberToStrX( p_nCount, 0 ) || ' bottle' || SalStrRepeatX( 's', SalNumberMin(
1, p_nCount - 1 ) )
          Else
            Return 'no more bottles'
      Function: gfVerse
        Description:
        Returns
          String:
        Parameters
          Number: p_nID
        Static Variables
        Local variables
          String: sVerse
        Actions
          Set sVerse	= gfBottle( p_nID ) || ' of beer on the wall, ' || gfBottle( p_nID ) || ' of
beer.' || CRLF
          !
          If p_nID = 0
            Return 'N' || SalStrRightX( sVerse, SalStrLength( sVerse ) - 1 ) || 'Go to the store and
buy some more, 99 bottles of beer on the wall.'
          Else
            Return sVerse || 'Take one down and pass it around, ' || gfBottle( p_nID - 1 ) || ' of
beer on the wall.' || CRLF || CRLF
      Function: gf99BottlesOfBear
        Description:
        Returns
        Parameters
        Static Variables
        Local variables
          Number: nCount
          String: sSong
        Actions
          Set nCount	= 99
          !
          While nCount >= 0
            Set sSong	= sSong || gfVerse( nCount )
            Set nCount	= nCount - 1
          !
          Call SalMessageBox( sSong, '', 0 )
    Named Menus
    Class Definitions
    Application Actions
      On SAM_AppStartup
        Call gf99BottlesOfBear( )

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: