home *** CD-ROM | disk | FTP | other *** search
- ***************************
-
- FUNCTION Bldtable
-
- PARAMETER _thearray, _thefile, _thefield
-
- IF PCOUNT() != 3
- RETURN(.F.)
- ELSEIF TYPE("_thearray") + TYPE("_thefile") != "AC"
- RETURN(.F.)
- ELSEIF !(TYPE("_thefield") $ "CN")
- RETURN(.F.)
- ELSEIF !EMPTY(_thefile)
- IF !FILE(Extention(_thefile, "dbf"))
- RETURN(.F.)
- ENDIF
- ENDIF
-
- PRIVATE _k, _mfld, _retto
-
- IF !EMPTY(_thefile) && If the alias or file is used!
- _retto = LTRIM(STR(SELECT()))
- SELECT 0
- USE ( _thefile )
- ENDIF
-
- IF TYPE("_thefield") = "N"
- _mfld = FIELDNAME( _thefield )
- ELSE
- _mfld = _thefield
- ENDIF
-
- IF TYPE(_mfld) = "U"
- USE
- SELECT &_retto.
- RETURN(.F.)
- ENDIF
-
- AFILL( _thearray, Make_empty("&_mfld") )
- GO TOP
- FOR _qaz = 1 TO MIN( LEN(_thearray), RECCOUNT() )
- _thearray[_qaz] = &_mfld.
- SKIP +1
- NEXT
-
- IF !EMPTY(_thefile) && If the alias or file is used!
- USE
- SELECT &_retto.
- ENDIF
-
- RETURN(.T.)
-
- * End of File