quisiera hacer un pdf del siguiente codigo
Código:
en un modulo:
Type Task
id As Integer
date As Date
name As String * 30
End Type
Option Explicit
Global file As Task
en el formulario
Private f_Canal As Integer ' canal del fichero.
Private Sub List1_Click()
Call BuscarItems(lisFechas.List(lisFechas.ListIndex))
End Sub
' Qué buscamos?: El dato (fecha), que se ha pulsado en list1...
' y lo buscamos en todos los registros del fichero.
Private Sub BuscarItems(ByVal strFecha As String)
Dim item As String
List2.Clear
Open App.Path & "\database.txt" For Random As f_canal Len = Len(file)
Seek (f_Canal), 1 ' posicionar el puntero de lectura al comienzo del fichero (en vb6 es la dirección 1).
Do While Not EOF(f_Canal)
Get f_Canal, , file
With file
If (StrComp(strFecha, CStr(.Date), vbTextCompare) = 0) Then
item = FormatStr(CStr(.Id), 6, True)
item = FormatStr(item, 12) & _
FormatStr(CStr(.Date), 16) & _
FormatStr(.Name, 44)
Call List2.AddItem(item) ' list2, probablemente no precise estar ordenado...
End If
End With
Loop
Close #f_canal
End Sub
gracias