VBI 75.PNG

Private Type Student
    SName As String * 20
    TM As String * 3
End Type

Private Sub Command1_Click()
    Dim MyRec As Student, Check As String, RecNo, SearchNo As Integer
    Open "Marks.dat" For Random Access Read Write As #1 Len = Len(MyRec)
    RecNo = 0
    Check = "Y"
    Do While Check = "Y" Or Check = "y"
        MyRec.SName = InputBox("Enter Student Name", "String")
        MyRec.TM = InputBox("Enter Total Marks", "Integer")
        RecNo = RecNo + 1
        Put #1, RecNo, MyRec
        Check = InputBox("Do You Want To Continue (Y/N) ?", "String")
    Loop
    SearchNo = InputBox("Which Record Do You Want To Search")
    Get #1, SearchNo, MyRec
    MyRec.TM = MyRec.TM + 10
    Put #1, SearchNo, MyRec
    Close #1
End Sub

VBO 75.PNG

Advertisements