home *** CD-ROM | disk | FTP | other *** search
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- '% (C) 1987 HUMBLEWARE Custom Programming Author: Lawrence A. Westhaver %
- '% 247 Paul Martin Drive, Baltimore MD 21227 (301) 799-1975 %
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- '% %
- '% FILENAME: CASE.SUB LAST UPDATE: 06-06-1987 %
- '% %
- '% DESCRIPTION: Two routines that convert strings to upper or lower case. %
- '% %
- '% CALL: CALL xCASE(IN$,OUT$) %
- '% %
- '% UCASE: Converts string to upper case. %
- '% %
- '% LCASE: Converts string to lower case. %
- '% %
- '% INPUTS: IN$ = Input string. %
- '% %
- '% OUTPUTS: OUT$ = Copy of input string converted to upper or lower %
- '% case. %
- '% %
- '% NOTE: These routines do not alter the original string specified %
- '% in IN$. They return a copy of the original string in OUT$ %
- '% with case conversion performed on the copy. %
- '% %
- '% If you want the original string altered, then call the %
- '% needed routine like this: %
- '% %
- '% CALL xCASE(IN$,IN$) %
- '% %
- '% This will cause the copy of the original string to be %
- '% assigned to the original. %
- '% %
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
- SUB UCASE(IN$,OUT$) Static
-
-
- 'copy input string to output string
-
- OUT$=IN$
-
- 'convert output string to uppercase
-
- FOR LEWP%=1 TO LEN(OUT$)
- CHAR$=MID$(OUT$,LEWP%,1)
- IF ASC(CHAR$)>96 AND ASC(CHAR$)<123 THEN
- MID$(OUT$,LEWP%,1)=CHR$(ASC(CHAR$)-32)
- END IF
- NEXT LEWP%
-
-
- END SUB 'ucase
-
-
-
- SUB LCASE(IN$,OUT$) Static
-
-
- 'copy input string to output string
-
- OUT$=IN$
-
- 'convert output string to lowercase
-
- FOR LEWP%=1 TO LEN(OUT$)
- CHAR$=MID$(OUT$,LEWP%,1)
- IF ASC(CHAR$)>64 AND ASC(CHAR$)<91 THEN
- MID$(OUT$,LEWP%,1)=CHR$(ASC(CHAR$)+32)
- END IF
- NEXT LEWP%
-
-
- END SUB 'lcase
-