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

  1. ********************
  2.  
  3. FUNCTION Deltkey
  4.  
  5.    PARAMETERS _tstring
  6.  
  7.    * first check the parameter
  8.    * next see if the key is in the stack.  If so,
  9.    *      just blank out the element
  10.    * The follow is a table:
  11.    *     0 = Did not add do improper parameter or array is not there
  12.    *    -1 = Item not in the array to delete
  13.    *    >0 = Element position now blanked out
  14.  
  15.    IF TYPE("_tstring") != "C"
  16.       RETURN(0)
  17.    ELSEIF EMPTY(AT("/", _tstring))   && Must be a good string
  18.       RETURN(0)
  19.    ELSEIF TYPE("setkeys") != "A"     && No array is present
  20.       RETURN(0)
  21.    ENDIF
  22.  
  23.    PRIVATE _first, _second, _qaz
  24.  
  25.    _first  = LTRIM(TRIM(SUBSTR(_tstring, 1, AT("/", _tstring)-1 )))
  26.    _second = TRIM(SUBSTR(_tstring,    AT("/", _tstring)+1 ))
  27.  
  28.    FOR _qaz = 1 TO LEN(setkeys)
  29.       IF _first = LTRIM(TRIM(SUBSTR(setkeys[_qaz], 1, AT("/", setkeys[_qaz])-1 )))
  30.          setkeys[_qaz] = ""
  31.          RETURN(_qaz)
  32.       ENDIF
  33.    NEXT
  34.    RETURN(-1)
  35.  
  36. * End of File
  37.