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

  1. ********************
  2.  
  3. FUNCTION Got
  4.  
  5.    PARAMETERS _file, _fieldno, _record
  6.  
  7.    PRIVATE _inb, _giveit, _retarea, _output, _close
  8.    
  9.    STORE "" TO _inb, _giveit, _retarea, _output
  10.  
  11.    _retarea = SELECT()
  12.    _close   = .F.
  13.  
  14.    IF TYPE("_file") = "C"
  15.       IF LEN(_file) = 1 .OR. ( VAL(_file) >= 1 .AND. VAL(_file) <= 200 )
  16.          SELECT &_file.
  17.       ELSEIF EMPTY(_file)
  18.          * this means that the file is already
  19.          * selected because it is being called with
  20.          * the extended () feature or the Mpop()
  21.          * needs to work in the current and open
  22.          * database
  23.          IF EMPTY(ALIAS())
  24.             RETURN("")
  25.          ENDIF
  26.       ELSE
  27.          SELECT 0
  28.          USE (_file)
  29.          _close = .T.
  30.       ENDIF
  31.    ELSEIF TYPE("_file") = "N"
  32.       SELECT (_file)
  33.    ELSE              
  34.       IF EMPTY(_file)
  35.          * this means that the file is already
  36.          * selected because it is being called with
  37.          * the extended () feature or the Mpop()
  38.          * needs to work in the current and open
  39.          * database
  40.          IF EMPTY(ALIAS())
  41.             RETURN("")
  42.          ENDIF
  43.       ENDIF
  44.    ENDIF
  45.  
  46.    IF _fieldno > FCOUNT()   && If the field number given is larger than
  47.       RETURN("")            && the number of fields in the database, just
  48.    ENDIF                    && return a null byte.
  49.  
  50.    IF _record = 0 .OR. LASTREC() = 0
  51.       GO TOP
  52.       _inb = FIELDNAME(_fieldno)
  53.       _giveit = &_inb
  54.       IF _close
  55.          USE
  56.       ENDIF
  57.       IF !EMPTY(_file)
  58.          SELECT (_retarea)
  59.       ENDIF
  60.       RETURN(MAKE_EMPTY(_giveit))
  61.    ELSE
  62.       GO _record
  63.    ENDIF
  64.    _inb = FIELDNAME(_fieldno)
  65.    _output = &_inb.
  66.    IF _close
  67.       USE
  68.    ENDIF
  69.    IF !EMPTY(_file)
  70.       SELECT (_retarea)
  71.    ENDIF
  72.    RETURN(_output)
  73.