Results 1 to 27 of 27

Thread: [RESOLVED] I need optimization/speed

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member RS_Arm's Avatar
    Join Date
    Mar 2007
    Location
    Planet Earth
    Posts
    282

    Resolved [RESOLVED] I need optimization/speed

    This is my code, which needs to be optimized

    My function geral.ReadFile:
    Code:
    Public Function ReadFile(FileName As String) As String
    Dim Container As String, Fich As Integer
    
    Fich = FreeFile
    
    Open FileName For Input As #Fich
    Container = Input(LOF(Fich), Fich)
    Close #Fich
    
    ReadFile = Container
    
    End Function
    In my sub:
    Code:
        Original = geral.ReadFile(OriginalFile)     
        ContainerTemp = geral.ReadFile(TempFile)              
        
        Original = Right(Original, Len(Original) - 25)  
        ContainerTemp = Right(ContainerTemp, Len(ContainerTemp) - 25)              
        
        
        If InStr(1, Original, ContainerTemp, vbBinaryCompare) >= 1 Then      
            Kill TempFile                                                           
        Else                                                                        
            Kill OriginalFile                                                       
            Name TempFile As OriginalFile                               
            ListNewRegs = ListNewRegs & OriginalFile & vbNewLine                
        
        End If
    Thank you in advance for any given tip.
    Last edited by RS_Arm; Dec 6th, 2007 at 07:33 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
  •  



Click Here to Expand Forum to Full Width