5 Replies - 560 Views - Last Post: 22 May 2012 - 02:21 PM Rate Topic: -----

#1 AlexxanderX  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 54
  • Joined: 13-January 12

Type mismatch error strike again

Posted 22 May 2012 - 03:11 AM

Hello, again I've a problem :( . When I try the the code in VB6 all works but when I compile it and try the exe I've have this error:

Quote

Run-time error '13': Type mismatch


Private Sub Command1_Click()
erroryearl = Len(Text1.Text)

If Combo1.ListIndex = -1 Then
        MsgBox "Selectati luna dorita!", vbCritical, "Eroare 2-01"
Else
    If Text1.Text = "" And erroryearl < 4 And erroryearl > 4 Then
        MsgBox "Introduceti anul infintarii firmei!", vbCritical, "Eroare 2-01"
Else

Open "C:\IMO Results\Entries\firdir.esse" For Input As #1
    Line Input #1, firdir
Close #1

Open firdir + "lunanr.esse" For Input As #1
    Line Input #1, lunanr
Close #1

If Combo1.ListIndex = 0 Then
    luna = "Ianuarie"
Else
    If Combo1.ListIndex = 1 Then
        luna = "Februarie"
    Else
        If Combo1.ListIndex = 2 Then
            luna = "Martie"
        Else
            If Combo1.ListIndex = 3 Then
                luna = "Aprilie"
            Else
                If Combo1.ListIndex = 4 Then
                    luna = "Mai"
                Else
                    If Combo1.ListIndex = 5 Then
                        luna = "Iunie"
                    Else
                        If Combo1.ListIndex = 6 Then
                            luna = "Iulie"
                        Else
                            If Combo1.ListIndex = 7 Then
                                luna = "August"
                            Else
                                If Combo1.ListIndex = 8 Then
                                    luna = "Septembrie"
                                Else
                                    If Combo1.ListIndex = 9 Then
                                        luna = "Octombrie"
                                    Else
                                        If Combo1.ListIndex = 10 Then
                                            luna = "Noiembrie"
                                        Else
                                            If Combo1.ListIndex = 11 Then
                                                luna = "Decembrie"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If

Open "C:\IMO Results\Entries\n.bat" For Input As #1
    Line Input #1, nrang
Close #1

firdirluna = firdir & Text1.Text & "\" & luna
firdirlunap = firdirluna & "\"
firfolder = firdir & Text1.Text

If FolderExists(firdirluna) Then
    MsgBox "Luna aleasa este deja activa!", vbCritical, "Eroare 2-01"
Else
If CInt(lunanr) = 0 Then
    If Not DirectoryExists(firfolder) Then
        MkDir firfolder
    End If
    MkDir CStr(firdirluna)
    
    Open firdir + "lunanume.esse" For Output As #3
        Print #3, luna
    Close #3
    
    Open firdir + "lunacont.esse" For Output As #1
        Print #1, firdirluna
    Close #1
    
    GoSub CopiereAngajati

    Open firdirlunap + "ln.esse" For Output As #23
        Print #23, nrang
    Close #23

    Open firdirlunap + "lt.esse" For Output As #24
        Print #24, "0"
    Close #24

    lunanrint = CStr(lunanr) + 1

    Open firdir + "lunanr.esse" For Output As #12
        Print #12, lunanrint
    Close #12

    Open firdir + "lunaactiva.esse" For Output As #22
        Print #22, "1"
    Close #22

    MsgBox "Succes!", vbInformation, "Succes!"
    Form1.Show
    Unload Me
    Exit Sub
    Else
If lunanr = "1" Or lunanr > "1" Then
End If
End If
    
CopiereAngajati:
ang1 = FreeFile

sumaf = "0"
sumaa = "0"
sumao = "0"

If nrang = "1" Then
    Open "C:\IMO Results\Entries\1.bat" For Input As #ang1
        Line Input #ang1, nume
        Line Input #ang1, cnp
        Line Input #ang1, adresa
        Line Input #ang1, localitate
    Close #ang1
    
    Open firdirlunap + "l1.esse" For Output As #ang1
        Print #ang1, nume
        Print #ang1, cnp
        Print #ang1, adresa
        Print #ang1, localitate
        Print #ang1, sumaf
        Print #ang1, sumaa
        Print #ang1, sumao
    Close #ang1
End If
ang2 = FreeFile
If nrang = "2" Then
    Open "C:\IMO Results\Entries\1.bat" For Input As #ang1
        Line Input #ang1, nume
        Line Input #ang1, cnp
        Line Input #ang1, adresa
        Line Input #ang1, localitate
    Close #ang1
    
    Open firdirlunap + "l1.esse" For Output As #ang1
        Print #ang1, nume
        Print #ang1, cnp
        Print #ang1, adresa
        Print #ang1, localitate
        Print #ang1, sumaf
        Print #ang1, sumaa
        Print #ang1, sumao
    Close #ang1
    
    Open "C:\IMO Results\Entries\2.bat" For Input As #ang2
        Line Input #ang2, nume
        Line Input #ang2, cnp
        Line Input #ang2, adresa
        Line Input #ang2, localitate
    Close #ang2
    
    Open firdirlunap + "l2.esse" For Output As #ang2
        Print #ang2, nume
        Print #ang2, cnp
        Print #ang2, adresa
        Print #ang2, localitate
        Print #ang2, sumaf
        Print #ang2, sumaa
        Print #ang2, sumao
    Close #ang2
End If
ang3 = FreeFile
If nrang = "3" Then
    Open "C:\IMO Results\Entries\1.bat" For Input As #ang1
        Line Input #ang1, nume
        Line Input #ang1, cnp
        Line Input #ang1, adresa
        Line Input #ang1, localitate
    Close #ang1
    
    Open firdirlunap + "l1.esse" For Output As #ang1
        Print #ang1, nume
        Print #ang1, cnp
        Print #ang1, adresa
        Print #ang1, localitate
        Print #ang1, sumaf
        Print #ang1, sumaa
        Print #ang1, sumao
    Close #ang1
    
    Open "C:\IMO Results\Entries\2.bat" For Input As #ang2
        Line Input #ang2, nume
        Line Input #ang2, cnp
        Line Input #ang2, adresa
        Line Input #ang2, localitate
    Close #ang2
    
    Open firdirlunap + "l2.esse" For Output As #ang2
        Print #ang2, nume
        Print #ang2, cnp
        Print #ang2, adresa
        Print #ang2, localitate
        Print #ang2, sumaf
        Print #ang2, sumaa
        Print #ang2, sumao
    Close #ang2
    
    Open "C:\IMO Results\Entries\3.bat" For Input As #ang3
        Line Input #ang3, nume
        Line Input #ang3, cnp
        Line Input #ang3, adresa
        Line Input #ang3, localitate
    Close #ang3
    
    Open firdirlunap + "l3.esse" For Output As #ang3
        Print #ang3, nume
        Print #ang3, cnp
        Print #ang3, adresa
        Print #ang3, localitate
        Print #ang3, sumaf
        Print #ang3, sumaa
        Print #ang3, sumao
    Close #ang3
End If
ang4 = FreeFile
If nrang = "4" Then
    Open "C:\IMO Results\Entries\1.bat" For Input As #ang1
        Line Input #ang1, nume
        Line Input #ang1, cnp
        Line Input #ang1, adresa
        Line Input #ang1, localitate
    Close #ang1
    
    Open firdirlunap + "l1.esse" For Output As #ang1
        Print #ang1, nume
        Print #ang1, cnp
        Print #ang1, adresa
        Print #ang1, localitate
        Print #ang1, sumaf
        Print #ang1, sumaa
        Print #ang1, sumao
    Close #ang1
    
    Open "C:\IMO Results\Entries\2.bat" For Input As #ang2
        Line Input #ang2, nume
        Line Input #ang2, cnp
        Line Input #ang2, adresa
        Line Input #ang2, localitate
    Close #ang2
    
    Open firdirlunap + "l2.esse" For Output As #ang2
        Print #ang2, nume
        Print #ang2, cnp
        Print #ang2, adresa
        Print #ang2, localitate
        Print #ang2, sumaf
        Print #ang2, sumaa
        Print #ang2, sumao
    Close #ang2
    
    Open "C:\IMO Results\Entries\3.bat" For Input As #ang3
        Line Input #ang3, nume
        Line Input #ang3, cnp
        Line Input #ang3, adresa
        Line Input #ang3, localitate
    Close #ang3
    
    Open firdirlunap + "l3.esse" For Output As #ang3
        Print #ang3, nume
        Print #ang3, cnp
        Print #ang3, adresa
        Print #ang3, localitate
        Print #ang3, sumaf
        Print #ang3, sumaa
        Print #ang1, sumao
    Close #ang3

    Open "C:\IMO Results\Entries\4.bat" For Input As #ang4
        Line Input #ang4, nume
        Line Input #ang4, cnp
        Line Input #ang4, adresa
        Line Input #ang4, localitate
    Close #ang4
    
    Open firdirlunap + "l4.esse" For Output As #ang4
        Print #ang4, nume
        Print #ang4, cnp
        Print #ang4, adresa
        Print #ang4, localitate
        Print #ang4, sumaf
        Print #ang4, sumaa
        Print #ang1, sumao
    Close #ang4
End If
ang5 = FreeFile
If nrang = "5" Then
    Open "C:\IMO Results\Entries\1.bat" For Input As #ang1
        Line Input #ang1, nume
        Line Input #ang1, cnp
        Line Input #ang1, adresa
        Line Input #ang1, localitate
    Close #ang1
    
    Open firdirlunap + "l1.esse" For Output As #ang1
        Print #ang1, nume
        Print #ang1, cnp
        Print #ang1, adresa
        Print #ang1, localitate
        Print #ang1, sumaf
        Print #ang1, sumaa
        Print #ang1, sumao
    Close #ang1
    
    Open "C:\IMO Results\Entries\2.bat" For Input As #ang2
        Line Input #ang2, nume
        Line Input #ang2, cnp
        Line Input #ang2, adresa
        Line Input #ang2, localitate
    Close #ang2
    
    Open firdirlunap + "l2.esse" For Output As #ang2
        Print #ang2, nume
        Print #ang2, cnp
        Print #ang2, adresa
        Print #ang2, localitate
        Print #ang2, sumaf
        Print #ang2, sumaa
        Print #ang2, sumao
    Close #ang2
    
    Open "C:\IMO Results\Entries\3.bat" For Input As #ang3
        Line Input #ang3, nume
        Line Input #ang3, cnp
        Line Input #ang3, adresa
        Line Input #ang3, localitate
    Close #ang3
    
    Open firdirlunap + "l3.esse" For Output As #ang3
        Print #ang3, nume
        Print #ang3, cnp
        Print #ang3, adresa
        Print #ang3, localitate
        Print #ang3, sumaf
        Print #ang3, sumaa
        Print #ang3, sumao
    Close #ang3

    Open "C:\IMO Results\Entries\4.bat" For Input As #ang4
        Line Input #ang4, nume
        Line Input #ang4, cnp
        Line Input #ang4, adresa
        Line Input #ang4, localitate
    Close #ang4
    
    Open firdirlunap + "l4.esse" For Output As #ang4
        Print #ang4, nume
        Print #ang4, cnp
        Print #ang4, adresa
        Print #ang4, localitate
        Print #ang4, sumaf
        Print #ang4, sumaa
        Print #ang4, sumao
    Close #ang4
    
    Open "C:\IMO Results\Entries\5.bat" For Input As #ang5
        Line Input #ang5, nume
        Line Input #ang5, cnp
        Line Input #ang5, adresa
        Line Input #ang5, localitate
    Close #ang5
    
    Open firdirlunap + "l5.esse" For Output As #ang5
        Print #ang5, nume
        Print #ang5, cnp
        Print #ang5, adresa
        Print #ang5, localitate
        Print #ang5, sumaf
        Print #ang5, sumaa
        Print #ang5, sumao
    Close #ang5
End If
ang6 = FreeFile
If nrang = "6" Then
    Open "C:\IMO Results\Entries\1.bat" For Input As #ang1
        Line Input #ang1, nume
        Line Input #ang1, cnp
        Line Input #ang1, adresa
        Line Input #ang1, localitate
    Close #ang1
    
    Open firdirlunap + "l1.esse" For Output As #ang1
        Print #ang1, nume
        Print #ang1, cnp
        Print #ang1, adresa
        Print #ang1, localitate
        Print #ang1, sumaf
        Print #ang1, sumaa
        Print #ang1, sumao
    Close #ang1
    
    Open "C:\IMO Results\Entries\2.bat" For Input As #ang2
        Line Input #ang2, nume
        Line Input #ang2, cnp
        Line Input #ang2, adresa
        Line Input #ang2, localitate
    Close #ang2
    
    Open firdirlunap + "l2.esse" For Output As #ang2
        Print #ang2, nume
        Print #ang2, cnp
        Print #ang2, adresa
        Print #ang2, localitate
        Print #ang2, sumaf
        Print #ang2, sumaa
        Print #ang2, sumao
    Close #ang2
    
    Open "C:\IMO Results\Entries\3.bat" For Input As #ang3
        Line Input #ang3, nume
        Line Input #ang3, cnp
        Line Input #ang3, adresa
        Line Input #ang3, localitate
    Close #ang3
    
    Open firdirlunap + "l3.esse" For Output As #ang3
        Print #ang3, nume
        Print #ang3, cnp
        Print #ang3, adresa
        Print #ang3, localitate
        Print #ang3, sumaf
        Print #ang3, sumaa
        Print #ang3, sumao
    Close #ang3

    Open "C:\IMO Results\Entries\4.bat" For Input As #ang4
        Line Input #ang4, nume
        Line Input #ang4, cnp
        Line Input #ang4, adresa
        Line Input #ang4, localitate
    Close #ang4
    
    Open firdirlunap + "l4.esse" For Output As #ang4
        Print #ang4, nume
        Print #ang4, cnp
        Print #ang4, adresa
        Print #ang4, localitate
        Print #ang4, sumaf
        Print #ang4, sumaa
        Print #ang4, sumao
    Close #ang4
    
    Open "C:\IMO Results\Entries\5.bat" For Input As #ang5
        Line Input #ang5, nume
        Line Input #ang5, cnp
        Line Input #ang5, adresa
        Line Input #ang5, localitate
    Close #ang5
    
    Open firdirlunap + "l5.esse" For Output As #ang5
        Print #ang5, nume
        Print #ang5, cnp
        Print #ang5, adresa
        Print #ang5, localitate
        Print #ang5, sumaf
        Print #ang5, sumaa
        Print #ang5, sumao
    Close #ang5
    
    Open "C:\IMO Results\Entries\6.bat" For Input As #ang6
        Line Input #ang6, nume
        Line Input #ang6, cnp
        Line Input #ang6, adresa
        Line Input #ang6, localitate
    Close #ang6
    
    Open firdirlunap + "l6.esse" For Output As #ang6
        Print #ang6, nume
        Print #ang6, cnp
        Print #ang6, adresa
        Print #ang6, localitate
        Print #ang6, sumaf
        Print #ang6, sumaa
        Print #ang6, sumao
    Close #ang6
End If
ang7 = FreeFile
If nrang = "7" Then
    Open "C:\IMO Results\Entries\1.bat" For Input As #ang1
        Line Input #ang1, nume
        Line Input #ang1, cnp
        Line Input #ang1, adresa
        Line Input #ang1, localitate
    Close #ang1
    
    Open firdirlunap + "l1.esse" For Output As #ang1
        Print #ang1, nume
        Print #ang1, cnp
        Print #ang1, adresa
        Print #ang1, localitate
        Print #ang1, sumaf
        Print #ang1, sumaa
        Print #ang1, sumao
    Close #ang1
    
    Open "C:\IMO Results\Entries\2.bat" For Input As #ang2
        Line Input #ang2, nume
        Line Input #ang2, cnp
        Line Input #ang2, adresa
        Line Input #ang2, localitate
    Close #ang2
    
    Open firdirlunap + "l2.esse" For Output As #ang2
        Print #ang2, nume
        Print #ang2, cnp
        Print #ang2, adresa
        Print #ang2, localitate
        Print #ang2, sumaf
        Print #ang2, sumaa
        Print #ang2, sumao
    Close #ang2
    
    Open "C:\IMO Results\Entries\3.bat" For Input As #ang3
        Line Input #ang3, nume
        Line Input #ang3, cnp
        Line Input #ang3, adresa
        Line Input #ang3, localitate
    Close #ang3
    
    Open firdirlunap + "l3.esse" For Output As #ang3
        Print #ang3, nume
        Print #ang3, cnp
        Print #ang3, adresa
        Print #ang3, localitate
        Print #ang3, sumaf
        Print #ang3, sumaa
        Print #ang3, sumao
    Close #ang3

    Open "C:\IMO Results\Entries\4.bat" For Input As #ang4
        Line Input #ang4, nume
        Line Input #ang4, cnp
        Line Input #ang4, adresa
        Line Input #ang4, localitate
    Close #ang4
    
    Open firdirlunap + "l4.esse" For Output As #ang4
        Print #ang4, nume
        Print #ang4, cnp
        Print #ang4, adresa
        Print #ang4, localitate
        Print #ang4, sumaf
        Print #ang4, sumaa
        Print #ang4, sumao
    Close #ang4
    
    Open "C:\IMO Results\Entries\5.bat" For Input As #ang5
        Line Input #ang5, nume
        Line Input #ang5, cnp
        Line Input #ang5, adresa
        Line Input #ang5, localitate
    Close #ang5
    
    Open firdirlunap + "l5.esse" For Output As #ang5
        Print #ang5, nume
        Print #ang5, cnp
        Print #ang5, adresa
        Print #ang5, localitate
        Print #ang5, sumaf
        Print #ang5, sumaa
        Print #ang5, sumao
    Close #ang5
    
    Open "C:\IMO Results\Entries\6.bat" For Input As #ang6
        Line Input #ang6, nume
        Line Input #ang6, cnp
        Line Input #ang6, adresa
        Line Input #ang6, localitate
    Close #ang6
    
    Open firdirlunap + "l6.esse" For Output As #ang6
        Print #ang6, nume
        Print #ang6, cnp
        Print #ang6, adresa
        Print #ang6, localitate
        Print #ang6, sumaf
        Print #ang6, sumaa
        Print #ang6, sumao
    Close #ang6
    
    Open "C:\IMO Results\Entries\7.bat" For Input As #ang7
        Line Input #ang7, nume
        Line Input #ang7, cnp
        Line Input #ang7, adresa
        Line Input #ang7, localitate
    Close #ang7
    
    Open firdirlunap + "l7.esse" For Output As #ang7
        Print #ang7, nume
        Print #ang7, cnp
        Print #ang7, adresa
        Print #ang7, localitate
        Print #ang7, sumaf
        Print #ang7, sumaa
        Print #ang7, sumao
    Close #ang7
End If
ang8 = FreeFile
If nrang = "8" Then
    Open "C:\IMO Results\Entries\1.bat" For Input As #ang1
        Line Input #ang1, nume
        Line Input #ang1, cnp
        Line Input #ang1, adresa
        Line Input #ang1, localitate
    Close #ang1
    
    Open firdirlunap + "l1.esse" For Output As #ang1
        Print #ang1, nume
        Print #ang1, cnp
        Print #ang1, adresa
        Print #ang1, localitate
        Print #ang1, sumaf
        Print #ang1, sumaa
        Print #ang1, sumao
    Close #ang1
    
    Open "C:\IMO Results\Entries\2.bat" For Input As #ang2
        Line Input #ang2, nume
        Line Input #ang2, cnp
        Line Input #ang2, adresa
        Line Input #ang2, localitate
    Close #ang2
    
    Open firdirlunap + "l2.esse" For Output As #ang2
        Print #ang2, nume
        Print #ang2, cnp
        Print #ang2, adresa
        Print #ang2, localitate
        Print #ang2, sumaf
        Print #ang2, sumaa
        Print #ang2, sumao
    Close #ang2
    
    Open "C:\IMO Results\Entries\3.bat" For Input As #ang3
        Line Input #ang3, nume
        Line Input #ang3, cnp
        Line Input #ang3, adresa
        Line Input #ang3, localitate
    Close #ang3
    
    Open firdirlunap + "l3.esse" For Output As #ang3
        Print #ang3, nume
        Print #ang3, cnp
        Print #ang3, adresa
        Print #ang3, localitate
        Print #ang3, sumaf
        Print #ang3, sumaa
        Print #ang3, sumao
    Close #ang3

    Open "C:\IMO Results\Entries\4.bat" For Input As #ang4
        Line Input #ang4, nume
        Line Input #ang4, cnp
        Line Input #ang4, adresa
        Line Input #ang4, localitate
    Close #ang4
    
    Open firdirlunap + "l4.esse" For Output As #ang4
        Print #ang4, nume
        Print #ang4, cnp
        Print #ang4, adresa
        Print #ang4, localitate
        Print #ang4, sumaf
        Print #ang4, sumaa
        Print #ang4, sumao
    Close #ang4
    
    Open "C:\IMO Results\Entries\5.bat" For Input As #ang5
        Line Input #ang5, nume
        Line Input #ang5, cnp
        Line Input #ang5, adresa
        Line Input #ang5, localitate
    Close #ang5
    
    Open firdirlunap + "l5.esse" For Output As #ang5
        Print #ang5, nume
        Print #ang5, cnp
        Print #ang5, adresa
        Print #ang5, localitate
        Print #ang5, sumaf
        Print #ang5, sumaa
        Print #ang5, sumao
    Close #ang5
    
    Open "C:\IMO Results\Entries\6.bat" For Input As #ang6
        Line Input #ang6, nume
        Line Input #ang6, cnp
        Line Input #ang6, adresa
        Line Input #ang6, localitate
    Close #ang6
    
    Open firdirlunap + "l6.esse" For Output As #ang6
        Print #ang6, nume
        Print #ang6, cnp
        Print #ang6, adresa
        Print #ang6, localitate
        Print #ang6, sumaf
        Print #ang6, sumaa
        Print #ang6, sumao
    Close #ang6
    
    Open "C:\IMO Results\Entries\7.bat" For Input As #ang7
        Line Input #ang7, nume
        Line Input #ang7, cnp
        Line Input #ang7, adresa
        Line Input #ang7, localitate
    Close #ang7
    
    Open firdirlunap + "l7.esse" For Output As #ang7
        Print #ang7, nume
        Print #ang7, cnp
        Print #ang7, adresa
        Print #ang7, localitate
        Print #ang7, sumaf
        Print #ang7, sumaa
        Print #ang7, sumao
    Close #ang7
    
    Open "C:\IMO Results\Entries\8.bat" For Input As #ang8
        Line Input #ang8, nume
        Line Input #ang8, cnp
        Line Input #ang8, adresa
        Line Input #ang8, localitate
    Close #ang8
    
    Open firdirlunap + "l8.esse" For Output As #ang8
        Print #ang8, nume
        Print #ang8, cnp
        Print #ang8, adresa
        Print #ang8, localitate
        Print #ang8, sumaf
        Print #ang8, sumaa
        Print #ang8, sumao
    Close #ang8
End If
ang9 = FreeFile
If nrang = "9" Then
    Open "C:\IMO Results\Entries\1.bat" For Input As #ang1
        Line Input #ang1, nume
        Line Input #ang1, cnp
        Line Input #ang1, adresa
        Line Input #ang1, localitate
    Close #ang1
    
    Open firdirlunap + "l1.esse" For Output As #ang1
        Print #ang1, nume
        Print #ang1, cnp
        Print #ang1, adresa
        Print #ang1, localitate
        Print #ang1, sumaf
        Print #ang1, sumaa
        Print #ang1, sumao
    Close #ang1
    
    Open "C:\IMO Results\Entries\2.bat" For Input As #ang2
        Line Input #ang2, nume
        Line Input #ang2, cnp
        Line Input #ang2, adresa
        Line Input #ang2, localitate
    Close #ang2
    
    Open firdirlunap + "l2.esse" For Output As #ang2
        Print #ang2, nume
        Print #ang2, cnp
        Print #ang2, adresa
        Print #ang2, localitate
        Print #ang2, sumaf
        Print #ang2, sumaa
        Print #ang2, sumao
    Close #ang2
    
    Open "C:\IMO Results\Entries\3.bat" For Input As #ang3
        Line Input #ang3, nume
        Line Input #ang3, cnp
        Line Input #ang3, adresa
        Line Input #ang3, localitate
    Close #ang3
    
    Open firdirlunap + "l3.esse" For Output As #ang3
        Print #ang3, nume
        Print #ang3, cnp
        Print #ang3, adresa
        Print #ang3, localitate
        Print #ang3, sumaf
        Print #ang3, sumaa
        Print #ang3, sumao
    Close #ang3

    Open "C:\IMO Results\Entries\4.bat" For Input As #ang4
        Line Input #ang4, nume
        Line Input #ang4, cnp
        Line Input #ang4, adresa
        Line Input #ang4, localitate
    Close #ang4
    
    Open firdirlunap + "l4.esse" For Output As #ang4
        Print #ang4, nume
        Print #ang4, cnp
        Print #ang4, adresa
        Print #ang4, localitate
        Print #ang4, sumaf
        Print #ang4, sumaa
        Print #ang4, sumao
    Close #ang4
    
    Open "C:\IMO Results\Entries\5.bat" For Input As #ang5
        Line Input #ang5, nume
        Line Input #ang5, cnp
        Line Input #ang5, adresa
        Line Input #ang5, localitate
    Close #ang5
    
    Open firdirlunap + "l5.esse" For Output As #ang5
        Print #ang5, nume
        Print #ang5, cnp
        Print #ang5, adresa
        Print #ang5, localitate
        Print #ang5, sumaf
        Print #ang5, sumaa
        Print #ang5, sumao
    Close #ang5
    
    Open "C:\IMO Results\Entries\6.bat" For Input As #ang6
        Line Input #ang6, nume
        Line Input #ang6, cnp
        Line Input #ang6, adresa
        Line Input #ang6, localitate
    Close #ang6
    
    Open firdirlunap + "l6.esse" For Output As #ang6
        Print #ang6, nume
        Print #ang6, cnp
        Print #ang6, adresa
        Print #ang6, localitate
        Print #ang6, sumaf
        Print #ang6, sumaa
        Print #ang6, sumao
    Close #ang6
    
    Open "C:\IMO Results\Entries\7.bat" For Input As #ang7
        Line Input #ang7, nume
        Line Input #ang7, cnp
        Line Input #ang7, adresa
        Line Input #ang7, localitate
    Close #ang7
    
    Open firdirlunap + "l7.esse" For Output As #ang7
        Print #ang7, nume
        Print #ang7, cnp
        Print #ang7, adresa
        Print #ang7, localitate
        Print #ang7, sumaf
        Print #ang7, sumaa
        Print #ang7, sumao
    Close #ang7
    
    Open "C:\IMO Results\Entries\8.bat" For Input As #ang8
        Line Input #ang8, nume
        Line Input #ang8, cnp
        Line Input #ang8, adresa
        Line Input #ang8, localitate
    Close #ang8
    
    Open firdirlunap + "l8.esse" For Output As #ang8
        Print #ang8, nume
        Print #ang8, cnp
        Print #ang8, adresa
        Print #ang8, localitate
        Print #ang8, sumaf
        Print #ang8, sumaa
        Print #ang8, sumao
    Close #ang8
    
    Open "C:\IMO Results\Entries\9.bat" For Input As #ang9
        Line Input #ang9, nume
        Line Input #ang9, cnp
        Line Input #ang9, adresa
        Line Input #ang9, localitate
    Close #ang9
    
    Open firdirlunap + "l9.esse" For Output As #ang9
        Print #ang9, nume
        Print #ang9, cnp
        Print #ang9, adresa
        Print #ang9, localitate
        Print #ang9, sumaf
        Print #ang9, sumaa
        Print #ang9, sumao
    Close #ang9
End If
ang10 = FreeFile
If nrang = "10" Then
    Open "C:\IMO Results\Entries\1.bat" For Input As #ang1
        Line Input #ang1, nume
        Line Input #ang1, cnp
        Line Input #ang1, adresa
        Line Input #ang1, localitate
    Close #ang1
    
    Open firdirlunap & "l1.esse" For Output As #ang1
        Print #ang1, nume
        Print #ang1, cnp
        Print #ang1, adresa
        Print #ang1, localitate
        Print #ang1, sumaf
        Print #ang1, sumaa
        Print #ang1, sumao
    Close #ang1
    
    Open "C:\IMO Results\Entries\2.bat" For Input As #ang2
        Line Input #ang2, nume
        Line Input #ang2, cnp
        Line Input #ang2, adresa
        Line Input #ang2, localitate
    Close #ang2
    
    Open firdirlunap + "l2.esse" For Output As #ang2
        Print #ang2, nume
        Print #ang2, cnp
        Print #ang2, adresa
        Print #ang2, localitate
        Print #ang2, sumaf
        Print #ang2, sumaa
        Print #ang2, sumao
    Close #ang2
    
    Open "C:\IMO Results\Entries\3.bat" For Input As #ang3
        Line Input #ang3, nume
        Line Input #ang3, cnp
        Line Input #ang3, adresa
        Line Input #ang3, localitate
    Close #ang3
    
    Open firdirlunap + "l3.esse" For Output As #ang3
        Print #ang3, nume
        Print #ang3, cnp
        Print #ang3, adresa
        Print #ang3, localitate
        Print #ang3, sumaf
        Print #ang3, sumaa
        Print #ang3, sumao
    Close #ang3

    Open "C:\IMO Results\Entries\4.bat" For Input As #ang4
        Line Input #ang4, nume
        Line Input #ang4, cnp
        Line Input #ang4, adresa
        Line Input #ang4, localitate
    Close #ang4
    
    Open firdirlunap + "l4.esse" For Output As #ang4
        Print #ang4, nume
        Print #ang4, cnp
        Print #ang4, adresa
        Print #ang4, localitate
        Print #ang4, sumaf
        Print #ang4, sumaa
        Print #ang4, sumao
    Close #ang4
    
    Open "C:\IMO Results\Entries\5.bat" For Input As #ang5
        Line Input #ang5, nume
        Line Input #ang5, cnp
        Line Input #ang5, adresa
        Line Input #ang5, localitate
    Close #ang5
    
    Open firdirlunap + "l5.esse" For Output As #ang5
        Print #ang5, nume
        Print #ang5, cnp
        Print #ang5, adresa
        Print #ang5, localitate
        Print #ang5, sumaf
        Print #ang5, sumaa
        Print #ang5, sumao
    Close #ang5
    
    Open "C:\IMO Results\Entries\6.bat" For Input As #ang6
        Line Input #ang6, nume
        Line Input #ang6, cnp
        Line Input #ang6, adresa
        Line Input #ang6, localitate
    Close #ang6
    
    Open firdirlunap + "l6.esse" For Output As #ang6
        Print #ang6, nume
        Print #ang6, cnp
        Print #ang6, adresa
        Print #ang6, localitate
        Print #ang6, sumaf
        Print #ang6, sumaa
        Print #ang6, sumao
    Close #ang6
    
    Open "C:\IMO Results\Entries\7.bat" For Input As #ang7
        Line Input #ang7, nume
        Line Input #ang7, cnp
        Line Input #ang7, adresa
        Line Input #ang7, localitate
    Close #ang7
    
    Open firdirlunap + "l7.esse" For Output As #ang7
        Print #ang7, nume
        Print #ang7, cnp
        Print #ang7, adresa
        Print #ang7, localitate
        Print #ang7, sumaf
        Print #ang7, sumaa
        Print #ang7, sumao
    Close #ang7
    
    Open "C:\IMO Results\Entries\8.bat" For Input As #ang8
        Line Input #ang8, nume
        Line Input #ang8, cnp
        Line Input #ang8, adresa
        Line Input #ang8, localitate
    Close #ang8
    
    Open firdirlunap + "l8.esse" For Output As #ang8
        Print #ang8, nume
        Print #ang8, cnp
        Print #ang8, adresa
        Print #ang8, localitate
        Print #ang8, sumaf
        Print #ang8, sumaa
        Print #ang8, sumao
    Close #ang8
    
    Open "C:\IMO Results\Entries\9.bat" For Input As #ang9
        Line Input #ang9, nume
        Line Input #ang9, cnp
        Line Input #ang9, adresa
        Line Input #ang9, localitate
    Close #ang9
    
    Open firdirlunap + "l9.esse" For Output As #ang9
        Print #ang9, nume
        Print #ang9, cnp
        Print #ang9, adresa
        Print #ang9, localitate
        Print #ang9, sumaf
        Print #ang9, sumaa
        Print #ang9, sumao
    Close #ang9
    
    Open "C:\IMO Results\Entries\10.bat" For Input As #ang10
        Line Input #ang10, nume
        Line Input #ang10, cnp
        Line Input #ang10, adresa
        Line Input #ang10, localitate
    Close #ang10
    
    Open firdirlunap + "l10.esse" For Output As #ang10
        Print #ang10, nume
        Print #ang10, cnp
        Print #ang10, adresa
        Print #ang10, localitate
        Print #ang10, sumaf
        Print #ang10, sumaa
        Print #ang10, sumao
    Close #ang10
End If
Return
    
End If

End If
    
End If
End Sub


Is This A Good Question/Topic? 0
  • +

Replies To: Type mismatch error strike again

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Type mismatch error strike again

Posted 22 May 2012 - 04:16 AM

You could try adding some debug statements into your code and a proper error handler.

For example, you could define a string and set it's value at certain positions in your code (maybe include variable values as well), in your error handler, you could then use a message box to display the last debug message. At least this would give you an indication as to where the error is, other than the unhandled Run-Time error.

When you run this using full compile in the environment using the same test criteria, you don't get any error at all?

Are you running the EXE on the same machine?
Was This Post Helpful? 0
  • +
  • -

#3 AlexxanderX  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 54
  • Joined: 13-January 12

Re: Type mismatch error strike again

Posted 22 May 2012 - 05:29 AM

I will come with a changed code with all what you says and try to see if still have the error

About your last question: Yes, the error was gived on another computer.
Was This Post Helpful? 0
  • +
  • -

#4 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Type mismatch error strike again

Posted 22 May 2012 - 07:44 AM

What I suggested, won't solve your problem, but it might narrow down where the error is occurring.

The code you have under your command button is quite large, so anything you can do to narrow it down as to where the problem is will help you solve it.
Was This Post Helpful? 0
  • +
  • -

#5 Neku  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 268
  • Joined: 21-May 09

Re: Type mismatch error strike again

Posted 22 May 2012 - 07:56 AM

i noticed something that may couse problems and that is this statement:

If Text1.Text = "" And erroryearl < 4 And erroryearl > 4 Then




shouldent it be "Or" insted of "And" between the erroryearl < 4 ... erroryearl > 4?
Was This Post Helpful? 0
  • +
  • -

#6 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Type mismatch error strike again

Posted 22 May 2012 - 02:21 PM

Neku's right. How can a number be both less than and greater than 4???

Also, Alexander, while you are to be commended for the neatness of your code, it is about 800 lines longer than it needs to be. If you'd like some help changing that, please let me know.

For one example, your Combo1 probably has the months of the year in the list. To get the selected value for your luna variable, luna = Combo1.Text is sufficient, assuming your Style property is set to 2. There you see, I've already shortened your code by 64 lines. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1