[
Structure rubrica
<VBFixedString(25)> Public nome As String
<VBFixedString(30)> Public cognome As String
<VBFixedString(12)> Public N_telefono As String
<VBFixedString(60)> Public osservazioni As String
End Structure
Dim cerca(700) As rubrica
Dim txt5 As String
Dim i As Integer
Dim lunghezzarec As Integer
Dim ultimacella As Integer
Dim posizione As Integer
Dim ultimorec As Integer
Private Sub registra_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
With cerca(700)
.cognome = TextBox1.Text
.nome = TextBox2.Text
.N_telefono = TextBox3.Text
.osservazioni = TextBox4.Text
End With
FilePut(2, cerca(700), ultimorec + 1)
PrintLine(1, TextBox1.Text + ";" + TextBox2.Text + ";" + TextBox3.Text + ";" + TextBox4.Text)
ultimorec = ultimorec + 1
lunghezzarec = Len(cerca(700))
ultimorec = LOF(2) \ lunghezzarec
posizione = ultimorec
End Sub
Private Sub cerca_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
FileClose(2)
FileOpen(2, "E:\rubbric.dat", OpenMode.Random, , , lunghezzarec)
posizione = 1
txt5 = TextBox5.Text
For Me.i = 0 To lunghezzarec
If cerca(700).cognome = txt5 Then
posizione = i
End If
Next
FileGet(2, cerca(700), i)
Dim n As String = Form5.DataGridView1.Rows.Add
Form5.DataGridView1.Rows(n).Cells(0).Value = cerca(700).cognome
Form5.DataGridView1.Rows(n).Cells(1).Value = cerca(700).nome
Form5.DataGridView1.Rows(n).Cells(2).Value = cerca(700).N_telefono
Form5.DataGridView1.Rows(n).Cells(3).Value = cerca(700).osservazioni
Form5.Show()
End Sub]
così forse è più chiaro...ma se uno chiedo aiuto a voi e voi dite così mi die a cosa servie a fare??? mah....se mi puoi auiutare aiutami se no...dillo subito...
""lo so che non ho bisogno di ripetere sempre l'indice.....ma lo faccio...xke è solo una bozza ...x capire ...un pò..."