home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Dbfmake
-
- PARAMETERS _thefile, _thearray
-
- IF PCOUNT() != 2
- RETURN(.F.)
- ENDIF
-
- PRIVATE _qaz, _atemp, _warray
-
- IF TYPE("_thefile")+TYPE("_thearray") != "C"
- RETURN(.F.)
- ELSE
- IF TYPE("_thearray") = "C" && One field, don't ask me why!
- _warray = .F.
- ELSEIF TYPE("_thearray") = "A"
- _warray = .T.
- ELSE
- RETURN(.F.)
- ENDIF
- ENDIF
-
-
- CREATE Template
- USE Template
- IF _warray
- FOR _qaz = 1 TO LEN(_thearray)
- IF TYPE("_thearray[_qaz]") = "U"
- USE
- ERASE Template.dbf
- RETURN(.F.)
- ENDIF
- _atemp = ""
- _atemp = _thearray[_qaz]
- AP_IT(PARSING(@_atemp), PARSING(@_atemp), VAL(PARSING(@_atemp)), IF( (EMPTY(_atemp)), 0, VAL(PARSING(@_atemp)) ) )
- NEXT
- ELSE
- _atemp = _thearray
- AP_IT(PARSING(@_atemp), PARSING(@_atemp), VAL(PARSING(@_atemp)), IF( (EMPTY(_atemp)), 0, VAL(PARSING(@_atemp)) ) )
- ENDIF
- USE
- CREATE (_thefile) FROM Template
- ERASE Template.dbf
- USE
- RETURN( DOSERROR() = 0 )
-
- * End of File