Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Win Directory to a dbf?
Message
From
11/07/2013 15:47:54
 
 
To
11/07/2013 14:06:50
General information
Forum:
Visual FoxPro
Category:
Contracts, agreements and general business
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 7
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01578214
Message ID:
01578225
Views:
56
>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()
Previous
Reply
Map
View

Click here to load this message in the networking platform