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

  1. ********************
  2.  
  3. FUNCTION Dbfmake
  4.  
  5.    PARAMETERS _thefile, _thearray
  6.  
  7.    IF PCOUNT() != 2
  8.       RETURN(.F.)
  9.    ENDIF
  10.  
  11.    PRIVATE _qaz, _atemp, _warray
  12.  
  13.    IF TYPE("_thefile")+TYPE("_thearray") != "C"
  14.       RETURN(.F.)
  15.    ELSE
  16.       IF TYPE("_thearray") = "C"    && One field, don't ask me why!
  17.          _warray = .F.
  18.       ELSEIF TYPE("_thearray") = "A"
  19.          _warray = .T.
  20.       ELSE
  21.          RETURN(.F.)
  22.       ENDIF
  23.    ENDIF
  24.  
  25.  
  26.    CREATE Template
  27.    USE Template
  28.    IF _warray
  29.       FOR _qaz = 1 TO LEN(_thearray)
  30.          IF TYPE("_thearray[_qaz]") = "U"
  31.             USE
  32.             ERASE Template.dbf
  33.             RETURN(.F.)
  34.          ENDIF
  35.          _atemp = ""
  36.          _atemp = _thearray[_qaz]
  37.          AP_IT(PARSING(@_atemp), PARSING(@_atemp), VAL(PARSING(@_atemp)), IF(  (EMPTY(_atemp)), 0, VAL(PARSING(@_atemp)) ) )
  38.       NEXT
  39.    ELSE
  40.       _atemp = _thearray
  41.       AP_IT(PARSING(@_atemp), PARSING(@_atemp), VAL(PARSING(@_atemp)), IF(  (EMPTY(_atemp)), 0, VAL(PARSING(@_atemp)) ) )
  42.    ENDIF
  43.    USE
  44.    CREATE (_thefile) FROM Template
  45.    ERASE Template.dbf
  46.    USE
  47.    RETURN( DOSERROR() = 0 )
  48.  
  49. * End of File
  50.