esempio di array a 4 righe(open/update)
codice:
Dim nomefile As String
Dim txt(0 To 3) As String
Private Sub Command1_Click()
Text1.Text = ""
CommonDialog1.ShowOpen
nomefile = CommonDialog1.FileName
' apre il file
Open nomefile For Input As #1
Do While Not EOF(1)
For i = 0 To 3
Input #1, txt(i)
Text1.Text = Text1.Text & txt(i) & vbCrLf
myarray(i).Text = txt(i)
Next
Loop
Close #1
End Sub
Private Sub Command2_Click()
' salva il file
Text1.Text = ""
Open nomefile For Output As #1
For i = 0 To 3
txt(i) = myarray(i).Text
Print #1, txt(i) & vbLf
Text1.Text = Text1.Text & txt(i) & vbCrLf
Next i
Close #1
End Sub
Private Sub Form_Load()
Reset
End Sub