28. april 2002 - 14:20Der er
7 kommentarer og 1 løsning
flere informationer på samme linie
hvordan henter man data fra en fil hvis jeg har gemt dataen i filen sådan : dim test(2) as string test(0) = "test0" test(1) = "test1" test(2) = "test2"
Print #1, test(0), test(1), test(2)
'det virker godt nok men jeg ved ikke hvordan man henter det igen og putter dataen tilbage i variablerne ?? På Forhånd Tak :)
Private Sub Form_Load() Open "C:\test.txt" For Input As #1 Input #1, test(0), test(1), test(2) Close #1 Text1.Text = test(0) & " " & test(1) & " " & test(2) End Sub
Private Sub Form_Unload(Cancel As Integer) test(0) = "test0" test(1) = "test1" test(2) = "test2" Open "C:\test.txt" For Output As #1 Print #1, test(0); ",", test(1); ",", test(2); "," Close #1 End Sub '----------------- Form1 -----------------
If Dir(strPath) > "" Then Open strPath For Input As #1 Input #1, test(0), test(1), test(2) Close #1 Text1.Text = test(0) & " " & test(1) & " " & test(2) End If End Sub
Private Sub Form_Unload(Cancel As Integer) test(0) = "test5" test(1) = "test6" test(2) = "test7" Open strPath For Output As #1 Print #1, test(0); ",", test(1); ",", test(2); "," Close #1 End Sub '----------------- Form1 -----------------
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.