Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Win Directory to a dbf?
Message
De
11/07/2013 15:47:54
 
 
À
11/07/2013 14:06:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrats & ententes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 7
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01578214
Message ID:
01578225
Vues:
54
>Hi.. I want to create a dbf from the contents of a windows xp directory. How? Thanks, Randy
*Dir2cursor.prg
Lparameters pcSkeleton, pcCursorname, plMoreinfo
Local lcFilename, llNeste, lcPath, lnLen
If Pcount()<1 Or Vartype(pcSkeleton)#'C' Or (Pcount()>1 And Vartype(pcCursorname)#'C')
   Return -1
Else    
   If Pcount()=1
      pcCursorname='curDumyDir'
   Endif 
   llNeste=.F.
   Create Cursor (pcCursorname) (filnavn c(1))
   Do While .t.
      If llNeste
         lcFilename=Sys(2000,pcSkeleton,1)
      Else 
         lcFilename=Sys(2000,pcSkeleton)
      Endif 
      If Len(lcFilename)>len(filnavn)
         lnLen=Len(lcFilename)
         Alter Table (pcCursorname) alter Column filnavn c(lnLen)
      Endif 
      If !Empty(lcFilename)
         Insert Into (pcCursorname) (filnavn) Values (Juststem(lcFilename))
      Else 
         Exit 
      Endif 
      llNeste=.T.
   Enddo 
Endif    
If Reccount()>0 And plMoreinfo
   Alter Table (pcCursorname) Add column dato d
   Alter Table (pcCursorname) Add column fsize i
   Alter Table (pcCursorname) Add column fulltnavn c(lnLen)
   Scan
      Adir(aDummy,(Addbs(justpath(pcSkeleton)) + Trim(filnavn) + '.' + Justext(pcSkeleton)))
      replace dato With aDummy(3), fsize With aDummy(2), fulltnavn With aDummy(1)
   Endscan 
Endif 
Return Reccount()
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform