|
-
Aug 14th, 2006, 02:55 PM
#1
Thread Starter
New Member
Part of my previous problem "Input file"
Hi all,
Private Sub Command1_Click()
Open "filesp" For Output As #1
v = 0
For j = 1 To 10
v = v + 3
Write #1, v
Picture1.Cls
Picture1.Print v
Next j
Close #1
End Sub
from above code I wrote some data in file like 3, 6,9................30. To call or read that data sequentially under the same command button I wrote the following code. but I am able to call only the first value like 3. After some time I want to call the data like 6 by pressing the same command button. I didn't get.So I am expecting help to overcome this problem.
Private Sub Command2_Click()
Dim v As Integer
Dim c As Integer
Open "filesp" For Input As #1
Input #1, v
c = v
Picture2.Cls
Picture2.Print c
'Next j
Close #1
End Sub
Thanks a lot for your answer
Bye
-
Aug 15th, 2006, 04:50 AM
#2
Re: Part of my previous problem "Input file"
try like this
VB Code:
Dim v As Integer
Dim c As Integer
Open "filesp" For Input As #1
Do While Not EOF(1)
Input #1, v
c = v
Picture2.Cls
Picture2.Print c
Loop
Close #1
Last edited by westconn1; Aug 15th, 2006 at 05:11 AM.
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Aug 15th, 2006, 05:50 AM
#3
Lively Member
Re: Part of my previous problem "Input file"
but maybe you have to delete "Picture2.Cls" command to display all read data
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|