Skip to content

Instantly share code, notes, and snippets.

@jabez007
Created November 14, 2017 14:24
Show Gist options
  • Save jabez007/a7ea9b9d088809124726880332eb5698 to your computer and use it in GitHub Desktop.
Save jabez007/a7ea9b9d088809124726880332eb5698 to your computer and use it in GitHub Desktop.
An "on demand" script written in PowerOn to recite 99 Bottles of Beer
[*
* Written in PowerOn, a language used to access the Episys database,
* Symitar's core processing soution for credit unions
*]
[This is a template for creating specfiles.]
TARGET=ACCOUNT [ Modify here]
DEFINE
[Define variables and arrays here.]
[Use descriptive names whenever possible.]
X = NUMBER
END
SETUP
[Prompt for user input.]
END
SELECT
[Indicate selection criteria here.]
[If using more than one criterion, they must be
connected by AND or OR.]
NONE
END
SORT
[Define up to six sort keys.]
[If standard subtotals are desired, use SUBTOTAL=]
END
PRINT TITLE = "99 Bottles of Beer" [Define report title]
[Headers and trailers (if any) must come first]
[Write statements to produce output for each
targeted record.]
FOR X = 99 TO 1 BY -1
DO
PRINT X
PRINT " bottle"
IF X > 1 THEN PRINT "s"
PRINT " of beer on the wall, "
PRINT X
PRINT " bottle"
IF X > 1 THEN PRINT "s"
PRINT " of beer."
NEWLINE
PRINT "Take one down and pass it around, "
IF (X - 1) > 0 THEN PRINT (X - 1)
ELSE IF (X - 1) = 0 THEN PRINT "no more"
PRINT " bottle"
IF (X - 1) <> 1 THEN PRINT "s"
PRINT " of beer on the wall."
NEWLINE
NEWLINE
END
PRINT "No more bottles of beer on the wall, no more bottles of beer."
NEWLINE
PRINT "Go to the store and buy some more, 99 bottles of beer on the wall."
NEWLINE
END
TOTAL
[If variables or arrays were accumulated in the
PRINT ddivision, print them out in the TOTAL
division in format of choice.]
END
PROCEDURE PROCEDURENAME
[Set up any called procedures.]
[Each procedure must have its own procedure name]
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment