home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST431.PRG < prev    next >
Encoding:
Text File  |  1989-08-14  |  1.0 KB  |  44 lines

  1. ********************
  2.  
  3. FUNCTION Rparsing
  4.  
  5.    PARAMETERS _getstr, _forcode
  6.  
  7.    * _getstr is the string to be parsed
  8.    * _forcode is the code that parses.
  9.  
  10.    * This function is the string parser.  Basically, return the
  11.    * beginning fragment of a string, adjust the string, and if
  12.    * passed by reference, alter the contents of the original
  13.    * string.
  14.  
  15.    PRIVATE _forcode, _location, _tempback, _width
  16.  
  17.    IF PCOUNT() = 2
  18.       IF TYPE("_forcode") = "L"
  19.          _thechar = "|"
  20.       ELSE
  21.          _thechar = _forcode
  22.       ENDIF
  23.       _forcode = .T.
  24.    ELSE
  25.       _forcode = .F.
  26.    ENDIF
  27.    
  28.    IF _forcode
  29.       _location   = RAT(_thechar, _getstr)
  30.       _width      = LEN(_thechar)
  31.    ELSE
  32.       _location   = IF(EMPTY(RAT("+", _getstr)), RAT("/", _getstr), RAT("+", _getstr))
  33.       _width      = 1
  34.    ENDIF
  35.  
  36.    _tempback = IF(!EMPTY(_location), SUBSTR(_getstr, _location + _width), _getstr)
  37.    _getstr = IF(!EMPTY(_location), SUBSTR(_getstr, 1, _location - 1), "")
  38.    RETURN(_tempback)
  39.  
  40. * End of File
  41.  
  42.  
  43.  
  44.