home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Parsing
-
- PARAMETERS _getstr, _forcode
-
- * _getstr is the string to be parsed
- * _forcode is the code that parses.
-
- * This function is the string parser. Basically, return the
- * beginning fragment of a string, adjust the string, and if
- * passed by reference, alter the contents of the original
- * string.
-
- PRIVATE _forcode, _location, _tempback, _width
-
- IF PCOUNT() = 2
- IF TYPE("_forcode") = "L"
- _thechar = "|"
- ELSE
- _thechar = _forcode
- ENDIF
- _forcode = .T.
- ELSE
- _forcode = .F.
- ENDIF
-
- IF _forcode
- _location = AT(_thechar, _getstr)
- _width = LEN(_thechar)
- ELSE
- _location = IF(EMPTY(AT("+", _getstr)), AT("/", _getstr), AT("+", _getstr))
- _width = 1
- ENDIF
-
- _tempback = IF(!EMPTY(_location), SUBSTR(_getstr, 1, _location - 1), _getstr)
- _getstr = IF(!EMPTY(_location), SUBSTR(_getstr, _location + _width), "")
- RETURN(_tempback)
-
- * End of File
-
-