Monday, 4 April 2016

LAB 6:Write a Visual Basic Program to create Sequential file containing name, address,city,pincode ect

Private Sub Command1_Click()
Open "C:\Users\Ritesh\Desktop\bca4.txt" For Append As #1
Write #1, Text1.Text, Text2.Text, Text3.Text, Text4.Text, Text5.Text
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Close #1
End Sub

Private Sub Command2_Click()
Open "C:\Users\Ritesh\Desktop\bca4.txt" For Input As #1
Input #1, variable1, variable2, variable3, variable4, variable5

Text1.Text = variable1
Text2.Text = variable2
Text3.Text = variable3
Text4.Text = variable4
Text5.Text = variable5
End Sub
Private Sub Command3_Click()
Input #1, variable1, variable2, variable3, variable4, variable5

Text1.Text = variable1
Text2.Text = variable2
Text3.Text = variable3
Text4.Text = variable4
Text5.Text = variable5
If EOF(1) Then
MsgBox ("file is finished")
Close #1
End If
End Sub

No comments:

Post a Comment