73) Design a form and write a program in visual basic for output file. The output file contains roll no, name and total marks of some student. Name of this output file is marks.dat. Append some record in same output file. Number of record can be input by the user from keyboard until he wants?

VBI 73

Private Sub Command1_Click()
    Dim SName As String
    Dim rn, tm As String
    Open "Marks.dat" For Append As #1
    rn = 1
    Do While rn > 0
        SName = InputBox("Enter Student Name", "String")
        rn = InputBox("Enter Roll No", "Integer")
        tm = InputBox("Enter Total Marks", "Integer")
        If rn = 0 Then
            Close #1
        End If
    Write #1, rn, SName, tm
End Sub

VBO 73


Comments are closed.

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: