Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Special Folder Code Doesn't Work
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Special Folder Code Doesn't Work
Miscellaneous
Thread ID:
00730390
Message ID:
00730390
Views:
53
Why doesn this work?

On the line after the comment, I get the error
"Member SUBFOLDERS does not evaulate to an object"

There are 4 subfolders, but this code doesnt see them.
Anyone know why?
LOCAL oFSO, cBaseFolder, nTotSubFolders, oFolder, nSubFolder

cBaseFolder = "C:\Documents and Settings\kmarois\Local Settings\Temporary Internet Files\Content.IE5\"

oFSO = CREATEOBJECT("scripting.filesystemobject")
oFolder = oFSO.GetFolder(cBaseFolder)

nTotSubFolders = oFolder.SubFolders.Count

FOR nSubFolder = 1 TO nTotSubFolders

  ? nTotSubFolders

  ** This line causes the error 
  cFolder = cBaseFolder + oFolder.SubFolders(nSubFolder).Name

  oSubFolder = oFSO.GetFolder(cFolder)
	
  FOR nFile 1 TO oSubFolder.Files.Count
		
    oSubFolder.Files(nFile).Delete()
	
  ENDFOR
	
ENDFOR
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform