Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete empty tables
Message
From
23/02/2005 10:48:18
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
23/02/2005 10:43:36
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00989602
Message ID:
00989640
Views:
18
Since you are working with a single table, there is no need for the "IN 0". Just SELECT 0 once, and then work with the current work area.
FOR i = 1 TO ALEN(aFileList, 1)

   select 0
   cTable = aFileList[i, 1]
   USE (cTable)
   iRecords = RECCOUNT()
   USE

   IF (iRecords = 0)
      DELETE FILE ("d:\ahsan\TEMP\" + cTable)
   ENDIF
>ENDFOR
Another option is to USE ... ALIAS TempTable, and then, USE IN TempTable.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform