[VB6] Help write to file

06/20/2010 08:10 ax5#1
Hi im trying to make a program that will add a text from textbox 1 and a ip adress to a text file but the program says text already exist all the time

PHP Code:
Option Explicit
Dim txtthere 
As Boolean
Private Sub Command1_Click()
If 
txtthere True Then
    MsgBox 
"There is already text there!"
Else
    
Dim sFileText As String
    Dim iFileNo 
As Integer
    iFileNo 
FreeFile
    
    Open App
.Path "\bt.txt" For Output As #iFileNo
    
Print #iFileNo, "74.125.87.103" & Text1.Text
    
Close #iFileNo
    
txtthere True
End 
If

End Sub

Private Sub Form_Load()
Dim sFileText As String
Dim iFileNo 
As Integer
iFileNo 
FreeFile
Dim i
Open App
.Path "\bt.txt" For Input As #iFileNo
    
Do While Not EOF(iFileNo)
        
Input #iFileNo, sFileText
        
1
    Loop
Close 
#iFileNo
If >= 1 Then
    txtthere 
True
Else
    
txtthere False
End 
If
End Sub