
15/06/2009, 19:40
|
| | Fecha de Ingreso: febrero-2009 Ubicación: Villa Ocampo - Santa Fe
Mensajes: 100
Antigüedad: 16 años, 2 meses Puntos: 0 | |
Respuesta: Archivo aleatorio Private Sub Command1_Click()
Dim num As Integer
'Dim vector
Dim con As Integer
num = FreeFile
Open "C:\palabras.txt" For Input As #num
Do While Not EOF(num)
Line Input #num, cadena
If T1.Text = cadena Then
con = con + 1
End If
T2.Text = con
Loop
Close #num
End Sub
Private Sub contar_Click()
Dim num As Integer
Dim cadena As Integer
num = FreeFile
If Dir("C:\palabras.txt") <> "" Then
Open "C:\palabras.txt" For Append As #num
Else
Open "C:\palabras.txt" For Output As #num
End If
Print #num, T1.Text
Close #num
T1.Text = ""
T1.SetFocus
End Sub
es un ejemplo muy sencillo espero te sirva |