$CPU 8086 ' make compatible with XT systems $LIB ALL OFF ' turn off all PowerBASIC libraries $ERROR ALL OFF ' turn off all PowerBASIC error checking $OPTIMIZE SIZE ' optimize for smaller code $COMPILE UNIT ' compile to a UNIT (.PBU) '$COMPILE EXE ' compile to a UNIT (.PBU) DEFINT A-Z ' Required for all numeric functions, forces PB to not ' include floating point in UNIT (makes it smaller) '/*------------------------------------------------------------------*/ $CODE SEG "MLIB4" '/*------------------------------------------------------------------*/ ' DBHDATE(FB) ' dBase Header Date. ' Returns string containing the date of the last update. ' FB is the File Buffer number returned from the DBOPEN subroutine. ' EXAMPLE: T$ = DBHDATE(1) '19970903' '/*------------------------------------------------------------------*/ FUNCTION DBHDATE(FB) PUBLIC AS STRING '/* --- Get Version --- SEEK #FB, 0 GET$ #FB, 1, T$ T = CVBYT(T$) '/* --- Get Header --- SEEK #FB, 0 GET$ #FB, 32, DBH$ '/* --- Get Date Fields --- IF T = 2 THEN T$ = MID$(DBH$,4,3) ELSE T$ = MID$(DBH$,2,3) END IF '/* --- Unpack Date Fields --- YY = CVBYT(MID$(T$,1,1)) YYYY = 1900 + YY YY$ = LTRIM$(STR$(YYYY)) MM = CVBYT(MID$(T$,2,1)) MM$ = LTRIM$(STR$(MM)) IF M < 10 THEN MM$ = "0" + MM$ DD = CVBYT(MID$(T$,3,1)) DD$ = LTRIM$(STR$(DD)) IF DD < 10 THEN DD$ = "0" + DD$ FUNCTION = YY$+MM$+DD$ END FUNCTION '/*------------------------------------------------------------------*/ ' $INCLUDE "C:\CODE\MLIB\MLIB.INC" '/* --- Correctly Open dBASE file and get needed info ---*/ '/* +- Pass the file buffer you want to use '/* ' +- Pass the dos file name '/* ' ' +- Returns the record length '/* ' ' ' +- Returns the number of records '/* ' ' ' ' +- Returns the header offset needed for dbseek '/* ' ' ' ' ' ' DBOPEN 1,"C:\CODE\DBASE.DBF",LRECL,NRECS#,OFFSET ' T$ = DBHDATE(1) ' PRINT T$ ' Y$ = GETKEY '/*------------------------------------------------------------------*/