DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: text files

  1. #1
    Join Date
    Oct 2005

    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"
    '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

    Close #2
    Close #3

    End Sub

    many thanks for all your help, always greatly appreciated
    Merry Christmas

  2. #2
    Join Date
    Aug 2005
    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.


  3. #3
    Join Date
    Nov 2003
    Portland, OR
    Rob: What is the error message?
    Phil Weber

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  4. #4
    Join Date
    Oct 2005

    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

  1. Read Large Text Files
    By Hutty in forum ASP.NET
    Replies: 0
    Last Post: 09-27-2005, 04:11 PM
  2. full text for files
    By yog in forum Database
    Replies: 0
    Last Post: 01-26-2002, 05:49 AM
  3. Script for scrolling
    By Mark in forum Web
    Replies: 3
    Last Post: 08-30-2001, 11:45 AM
  4. Double Text 1.0
    By George Gilbert in forum vb.announcements
    Replies: 0
    Last Post: 08-19-2001, 11:34 AM
  5. Can the ADO Text Driver Update Text Files?
    By Larry Rebich in forum VB Classic
    Replies: 1
    Last Post: 12-15-2000, 11: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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center