-
text files
Hi all ,
first of Merry Christmas to you all and i hope all your wishes come true
i have a problem with the code below, it was designed to compaare two text files and then write the differences in another text file
it all works but then gives me an error in my 'ComparTextFiles Sub' on the line 'Current.Value = Current.Value + Len(CurrentLine)' and i have no idea why please could someone share there ideas or opinions of this code
listed below is the code i use including the code i use to call this sub
Private Sub Command1_Click()
CompareTextFiles "" & Text1 & "", "" & Text2 & "", "" & Text3 & ""
End Sub
Private Sub CompareTextFiles(Fileone As String, Filetwo As String, Output As String)
Open Fileone For Input As #1
Fileonelen = LOF(1)
FileoneRead = Input(Fileonelen, #1)
Close #1
Open Filetwo For Input As #2
Open Output For Output As #3
Do While Not EOF(2)
Line Input #2, CurrentLine
Current.Value = Current.Value + Len(CurrentLine)
If InStr(1, UCase(FileoneRead), UCase(CurrentLine)) Then
MsgBox "No Differences Were Found", 0, "EMIS PCC"
Else
'difference found, write it to the output file
Print #3, CurrentLine
MsgBox "Some Differences Were Found, Please Refer To Outputed File For More Information", 0, "EMIS PCC"
End If
Loop
Close #2
Close #3
End Sub
many thanks for all your help, always greatly appreciated
Merry Christmas
Rob
-
Because you have not shown any Variable Dimensioning, the obvious answer is in the 'Current.Value' which I would guess should be 'CurrentValue'.
There are other things within the code which do not make sense unless they are dimensioned elsewhere.
Merry Christmas to you as well.
Steve.
-
Rob: What is the error message?
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
Hi Phil
Merry christmas mate
the actual error message is Run Time error 424 Object required it then highlights the following line of my code
'Current.Value = Current.Value + Len(CurrentLine)'
thanks in advance
Similar Threads
-
By Hutty in forum ASP.NET
Replies: 0
Last Post: 09-27-2005, 04:11 PM
-
Replies: 0
Last Post: 01-26-2002, 04:49 AM
-
Replies: 3
Last Post: 08-30-2001, 11:45 AM
-
By George Gilbert in forum vb.announcements
Replies: 0
Last Post: 08-19-2001, 11:34 AM
-
By Larry Rebich in forum VB Classic
Replies: 1
Last Post: 12-15-2000, 10:29 AM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks