|
-
Jun 27th, 2004, 11:16 PM
#1
Thread Starter
Hyperactive Member
Looping...
Hey all!
I need to open a folder, loop through it, grab all the .XFC files, load them into my app, then loop through hte loaded files and do something with each one of them? Anyone know how to do this?
Kevin Carpenter
Currently Working in the CAOS (CA Operating System) Group
-
Jun 27th, 2004, 11:27 PM
#2
Frenzied Member
VB Code:
Dim sDirectory As String, sFilename As String, sFilepath As String
Dim lFilenum As Long
sDirectory = "C:\"
'Get the first matching file
sFilename = Dir$(sDirectory & "*.xfc")
Do While Len(sFilename) > 0
sFilepath = sDirectory & sFilename
lFilenum = FreeFile
'Open the file
Open sFilepath For Input As #lFilenum
'Now do whatever you want to do with the files
'bla bla bla
'Close the file
Close #lFilenum
'Get the next matching file
sFilename = Dir$
Loop
-
Jun 27th, 2004, 11:35 PM
#3
Thread Starter
Hyperactive Member
How do I get the text into a variable? Thanks.
Kevin Carpenter
Currently Working in the CAOS (CA Operating System) Group
-
Jun 28th, 2004, 12:10 AM
#4
VB Code:
'Open the file
Open sFilepath For Input As #lFilenum
'Read stuff into Buffer
Buffer = Input(LOF(lFilenum), lFilenum)
'Now do whatever you want to do with the files
'bla bla bla
'Close the file
Close #lFilenum
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|