DBFCDX bug when filenames contain dots?

140 views
Skip to first unread message

Juan Gálvez

unread,
Mar 25, 2024, 8:31:52 AMMar 25
to Harbour Developers
Hi All,

I've noticed when dbf files have dots in their name the fpt extension for memo files isn't assigned...

Please look at the output of this code:

#INCLUDE "DIRECTRY.CH"

PROCEDURE Main()
   LOCAL cFile, aFile
   REQUEST DBFFPT, DBFCDX
   CLEAR SCREEN
   ? Version()
   ?
   FOR EACH cFile IN {"_file1_.dbf","_file1.dot_.dbf","_file2_.dbf","_file2.dot_.dbf"}
  hb_DbDrop( cFile )
      IF cFile:__EnumIndex() < 3
         DbCreate( cFile, { {"One","N",2,0} }, "DBFCDX", .T. )
      ELSE
         DbCreate( cFile, { {"One","N",2,0}, {"Two","M",10,0} }, "DBFCDX", .T. )
      ENDIF  
      INDEX ON FIELD->One TAG One
      DbCloseArea()
  FOR EACH aFile IN hb_vfDirectory( hb_FNameExtSet( cFile, ".*" ) )
         ? aFile[F_NAME]
      NEXT
      ?
   NEXT
   RETURN

Any comments?
Reply all
Reply to author
Forward
0 new messages