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

  1. ***************************
  2.  
  3. FUNCTION Bldtable
  4.  
  5.    PARAMETER _thearray, _thefile, _thefield
  6.  
  7.    IF PCOUNT() != 3
  8.       RETURN(.F.)
  9.    ELSEIF TYPE("_thearray") + TYPE("_thefile") != "AC"
  10.       RETURN(.F.)
  11.    ELSEIF !(TYPE("_thefield") $ "CN")
  12.       RETURN(.F.)
  13.    ELSEIF !EMPTY(_thefile)
  14.       IF !FILE(Extention(_thefile, "dbf"))
  15.          RETURN(.F.)
  16.       ENDIF
  17.    ENDIF
  18.  
  19.    PRIVATE _k, _mfld, _retto
  20.  
  21.    IF !EMPTY(_thefile)               && If the alias or file is used!
  22.       _retto = LTRIM(STR(SELECT()))
  23.       SELECT 0
  24.       USE ( _thefile )
  25.    ENDIF
  26.  
  27.    IF TYPE("_thefield") = "N"
  28.       _mfld = FIELDNAME( _thefield )
  29.    ELSE
  30.       _mfld = _thefield
  31.    ENDIF
  32.  
  33.    IF TYPE(_mfld) = "U"
  34.       USE
  35.       SELECT &_retto.
  36.       RETURN(.F.)
  37.    ENDIF
  38.  
  39.    AFILL( _thearray, Make_empty("&_mfld") )
  40.    GO TOP
  41.    FOR _qaz = 1 TO MIN( LEN(_thearray), RECCOUNT() )
  42.       _thearray[_qaz] = &_mfld.
  43.       SKIP +1
  44.    NEXT
  45.  
  46.    IF !EMPTY(_thefile)    && If the alias or file is used!
  47.       USE
  48.       SELECT &_retto.
  49.    ENDIF
  50.  
  51.    RETURN(.T.)
  52.  
  53. * End of File
  54.