|
-
Apr 6th, 2005, 01:31 PM
#1
Re: [RESOLVED] - Search Text File
I think you need to explain it better. If this is solved (which I don't think it is since the bottom post has a new question on it), please state it better. I personally don't understand.
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 6th, 2005, 01:55 PM
#2
Thread Starter
Lively Member
Re: [RESOLVED] - Search Text File
Heres what I have
VB Code:
Private Sub tSearch_Timer()
txt.Caption = "Searching for ukf_infantry.pbo..."
Dim CSIDL As Long
Dim DefPath As String
DefPath = GetFolderPath(CSIDL_PROGRAM_FILES)
DefFold = DefPath & "\Codemasters\OperationFlashpoint\@ECP\Addons\"
Dim tempStr As String, Ret As Long
tempStr = String(MAX_PATH, 0)
Ret = SearchTreeForFile(DefFold, HOWD I PUT OUTPUT HERE??, tempStr)
If Ret <> 0 Then
With lst
.AddItem HOWD I PUT OUTPUT HERE?? & " - " & DefFold & "ukf_infantry"
End With
Else
End If
tSearch.Enabled = False
End Sub
Private Sub txtSearch_Click()
txtSearch.Enabled = False
Open (App.Path & "\flz.22") For Input As #1
Do While Not EOF(1)
Line Input #1, TLine
Loop
Close #1
defFol.Enabled = False
tSearch.Enabled = True
End Sub
I want it to search for the first line, third line, fifth line etc of what is in the text file. So basically, can i turn each line found from the text file into a global string?
-
Apr 6th, 2005, 02:03 PM
#3
Re: [RESOLVED] - Search Text File
as you are going through the loop, have a counter keeping record of which line you are on then check if the number is odd, if it is then add it to the string.
do you want an array or one long string of what you find ?
casey.
-
Apr 6th, 2005, 04:10 PM
#4
Thread Starter
Lively Member
Re: Search Text File
Say line one of the text is EXAMPLE i want to make that line into a string so i can do something like
Search examplestringname.
?? lol
-
Apr 6th, 2005, 04:27 PM
#5
Re: Search Text File
correct me if i am wrong, are you searching the textfile and if the line(filename) is a .pbo extension then add it to a listbox ?, if so then try this.
VB Code:
Dim TLine As String
Open (App.Path & "\flz.22") For Input As #1
Do While Not EOF(1)
Line Input #1, TLine
If Right$(TLine, 4) = ".pbo" Then
List1.AddItem TLine
End If
Loop
Close #1
casey.
-
Apr 6th, 2005, 04:47 PM
#6
Thread Starter
Lively Member
Re: Search Text File
No. Heres the situation. I need a programme to find out if a person has files missing in a certain folder. So if they don't have that file then it's added to the list. All the files are .pbo.
-
Apr 6th, 2005, 04:57 PM
#7
Re: Search Text File
if the certain folder is the same one all the time then use the Dir() function aswell to check if it exists, if it doesnt then add the item.
VB Code:
Dim TLine As String
Open (App.Path & "\flz.22") For Input As #1
Do While Not EOF(1)
Line Input #1, TLine
If Dir$("C:\thepath\tothe\folder\" & TLine) = "" Then
List1.AddItem TLine
End If
Loop
Close #1
is this it or am i just confused
casey.
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
|