home *** CD-ROM | disk | FTP | other *** search
- -PLUSOPS 1
- *
- * This SNOBOL4+ utility program converts text files containing upper and
- * lower case ASCII alphabetic text to all-upper-case or all-lower-case.
- * It also can swap both simultaneously to perform case inversion.
- * The program is written simply (it could be considerably shorter) to
- * demonstrate simple SNOBOL4+ programming techniques. It shows just how
- * easy it is to manipulate and filter text files using SNOBOL4+.
- * This program has been written to accept command line options to permit
- * the same program to do the work of what might otherwise be three separate
- * programs. However, it is interesting to note that each of those three
- * separate programs, written in SNOBOL4+, would be only two lines long
- * (and, one of those is simply the END statement!)
- * Sample command line to run this program:
- *
- * SNORUN CASE <ASMLC.ASM >ASMUC.ASM;/U
- *
- SCREEN = "CASE 1.0 Alphabetic Case Conversion Program"
- SCREEN = " Copyright 1986, Gordon E. Peterson II"
- INPUT(.INPUT,,"R,1000")
- OUTPUT(.OUTPUT,,"W,1000")
- *
- UPARM = REPLACE(&PARM,&LCASE,&UCASE)
- &TRIM = 1
- *
- UPARM BREAKX("/") LEN(1) "U" :S(TOUPPER)
- UPARM BREAKX("/") LEN(1) "L" :S(TOLOWER)
- SCREEN =
- SCREEN = "Usage: CASE <inputfile >outputfile;<options>"
- SCREEN = " <options> = /L and/or /U"
- SCREEN = " /L = convert to lower case"
- SCREEN = " /U = convert to upper case"
- SCREEN = " (both) = invert case" :(END)
- *
- TOUPPER FROM = &LCASE
- TO = &UCASE
- UPARM BREAKX("/") LEN(1) "L" :F(CVTIT)
- *
- TOLOWER FROM = FROM &UCASE
- TO = TO &LCASE
- *
- CVTIT OUTPUT = REPLACE(INPUT,FROM,TO) :S(CVTIT)
- END
-
-