Cie AS Computing
Dear all,
Welcome to AS computing class. I am Dr.Ravi your facilitator for this course. This course consists of two modules, theory and practicals. In theory we will have 12 chapters and in practicals we do have programming classes. You will sit for theory and practical exams at the end of the course, which is conducted by CIE.
All the best, keep moving, for there is always a helping hand above you to guide you.
Dr.Ravi
Tags:
READ DATA
Open "c:\asyraf" For Input As #1
Form1.Print "Name Phone No"
20 If EOF(1) Then GoTo 80
Input #1, x, y
Print Form1 x, y
GoTo 20
80 Close
i think the command "print form1 x,y" is wrong
it should be like this, "Form1.Print x,y" right?
the file cannot be read i think.because the computer reads only from the start of the file.when we last added a data, the pointer is situated at the EOF, therefore including EOF is a must when reading a file
I cant seem to get to do this even though i took the exact comman from what asyraf had posted. is there sumthing wrong in the commands?
Ravichandran said:What will happen when you dont use EOF while accessing a sequential file records.
Dr.RAvi
Cho...ur right!!! I missed tht one...now afifah...i think thts why u cant get it right,,,,try changing tht
Muhammad Mujahid Lokman said:
READ DATA
Open "c:\asyraf" For Input As #1
Form1.Print "Name Phone No"
20 If EOF(1) Then GoTo 80
Input #1, x, y
Print Form1 x, y
GoTo 20
80 Close
i think the command "print form1 x,y" is wrong
it should be like this, "Form1.Print x,y" right?
Afifah Ahmad said:
the file cannot be read i think.because the computer reads only from the start of the file.when we last added a data, the pointer is situated at the EOF, therefore including EOF is a must when reading a file
I cant seem to get to do this even though i took the exact comman from what asyraf had posted. is there sumthing wrong in the commands?
Ravichandran said:What will happen when you dont use EOF while accessing a sequential file records.
Dr.RAvi
[WTTell]
succesfully installed vb on windows 7..if you guys need the installer..you can take it from me...the install guide can be found here http://www.fortypoundhead.com/showcontent.asp?artid=20502
Amir, please post how u managed to do it?? I think i made a mistake somewhere~~ =.-"
Amir, please post how u managed to do it?? I think i made a mistake somewhere~~ =.-"
Dear Guys, I can see most of you have tried sequential files. I wish you continue with this example as your base and move on to more innovative codes. All the best.
Hopefull, Faiz and Raj needs to share with us what was their experience in this task.
Dr.Ravi
What we learned yesterday~~
Private Sub Command1_Click()
Open "c:\phonebook" For Output As #1
Close
End Sub
Private Sub Command2_Click()
Open "c:\phonebook" For Append As #1
a = InputBox("Name")
b = InputBox("Phone Number")
Write #1, a, b
Close
End Sub
Private Sub Command3_Click()
Open "c:\phonebook" For Input As #1
x = InputBox("Please enter name")
Form1.Print , "Phone No."
20 If EOF(1) Then Close
Input #1, a, b
If x = a Then Print b
GoTo 20
Close
End Sub
Guys, can I know the command how to clear all the data that is stored in the programming system?
you should add this
20 if eof(1) then go to 8
x=inputbox ("search name")
9 input #1, a, b
if x=a then print b
if not x=a then go to 9
8 close
Dain Razali said:
What we learned yesterday~~
Private Sub Command1_Click()
Open "c:\phonebook" For Output As #1
Close
End Sub
Private Sub Command2_Click()Open "c:\phonebook" For Append As #1
a = InputBox("Name")
b = InputBox("Phone Number")
Write #1, a, b
Close
End Sub
Private Sub Command3_Click()Open "c:\phonebook" For Input As #1
x = InputBox("Please enter name")
Form1.Print , "Phone No."
20 If EOF(1) Then Close
Input #1, a, b
If x = a Then Print b
GoTo 20
Close
End Sub
© 2025 Created by Ravichandran.
Powered by