Results 1 to 9 of 9

Thread: error:variable not defined?????

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    error:variable not defined?????

    Code:
    Private Sub mnuFileMRU_Click(index As Integer)
    
        strFileNewName1 = (Left(mnuFileMRU(index).Caption, InStr(1, mnuFileMRU(index).Caption, "\DAF")) & "Map\")
        strFileNewName2 = (Mid(mnuFileMRU(index).Caption, InStr(1, mnuFileMRU(index).Caption, "MY"), 8) & ".bmp")
        strFileNewName3 = strFileNewName1 & strFileNewName2
        'MsgBox " " & strFileNewName3
        
        Picture1.Picture = LoadPicture(strFileNewName3)
        
       Call ConvertMRU
       End Sub
    
    Private Sub ConvertMRU()
    
        Dim intFF As Integer
        Dim strReaded() As String
        Dim index as integer    
           intFF = FreeFile
           
                Open mnuFileMRU(index).Caption For Input As #intFF
                    strReaded = Split(Input(LOF(intFF), #intFF), vbLf)
               Close #intFF
             
             strFileNewName4 = (Left(mnuFileMRU(index).Caption, InStr(1, mnuFileMRU(index).Caption, "\DAF")) & "Setting\Daf.txt")
             'MsgBox "" & strFileNewName4
             
            intFF = FreeFile
                Open strFileNewName4 For Output As #intFF
                    Print #intFF, Join(strReaded, vbCrLf);
                Close #intFF
    
    End Sub
    above is part of my code. it came out an error "variable not defined" and point to index(the red color). how to improve the code above?
    Last edited by junlo; Mar 13th, 2007 at 12:27 PM.

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