home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Formalize
-
- PARAMETERS _thestring, _exceptions
-
- IF PCOUNT() = 1
- _exceptions = ""
- ENDIF
-
- IF TYPE("_exceptions") = "C"
- PRIVATE _tempex, _tlen
- _tempex = _exceptions
- _tlen = OCCURENCE("/", _exceptions)
- IF EMPTY(_tlen)
- _tlen = OCCURENCE("+", _exceptions)
- IF EMPTY(_tlen)
- DECLARE _exceptions[1]
- _exceptions[1] = _tempex
- ELSE
- DECLARE _exceptions[_tlen + 1]
- FOR _qaz = 1 TO _tlen + 1
- _exceptions[_qaz] = PARSING(@_tempex)
- NEXT
- ENDIF
- ELSE
- DECLARE _exceptions[_tlen+1]
- FOR _qaz = 1 TO _tlen + 1
- _exceptions[_qaz] = PARSING(@_tempex)
- NEXT
- ENDIF
- ENDIF
-
- PRIVATE _newstring, _tempstr
-
- STORE "" TO _newstring, _tempstr
-
- DO WHILE !EMPTY(_thestring)
- _tempstr = PARSING(@_thestring, " ")
- IF LEN(_tempstr) = 1
- _tempstr = IF( (UPPER(_tempstr) != "I"), LOWER(_tempstr), UPPER(_tempstr) )
- ELSE
- IF TYPE("_exceptions") = "A"
- IF EMPTY(ASCAN(_exceptions, _tempstr))
- _tempstr = UPPERLOWER(_tempstr)
- ENDIF
- ELSE
- _tempstr = UPPERLOWER(_tempstr)
- ENDIF
- ENDIF
- _newstring = _newstring + " " + _tempstr
- ENDDO
- RETURN(IF(SUBSTR(_newstring, 1, 1) = " ", SUBSTR(_newstring, 2), _newstring))
-
- * End of File
-