1. Assuming that there is a user-defined data type that is defined as follows: Type EmployeeInfo Name As String * 40 Age As Integer End Type What does the following code do? Dim FileNum As Integer Dim Employee As EmployeeInfo FileNum = FreeFile Open "EMPLOYEE.DAT" For Random As FileNum Len = Len(PersonInfo) Employee.Name = "JOHN SMITH" Employee.Age = 32 Put FileNum, 5, Employee 2. Assuming that there is a user-defined data type that is defined as follows: Type EmployeeInfo Name As String * 40 Age As Integer End Type What does the following code do? Dim FileNum As Integer Dim Employee As EmployeeInfo FileNum = FreeFile Open "EMOLOYEE.DAT" For Random As FileNum Len = Len(Employee) 3. What does the following code do? FileNum = FreeFile Open "TRY>TXT" For Output As FileNum Print #FileNum, txtMyText.Text Close FileNum 4. What do the following statements do? FileNum = FreeFile Open "C:\TRY\TRY.TXT" For Apppend As FileNum 5. What does the following code do? FileNum = Free File Open "INFO>TXT" For Append As FileNum txtMyText.Text = Input$(LOF(FileNum), FileNum) Close FileNum 6. What does the following code do? FileNum = FreeFile Open "INFO>TXT" For Append As FileNum Print #FileNum, txtMyText.Text Close FileNum 7. What does the following code do? FileNum = FreeFile Open "TRY.DAT" For Binary As FileNum MyString = "THIS IS A TEST!" Put #FileNum, 75, MyString 8. What does the following code do? FileNum = FreeFile Open "TRY.DAT" For Binary as FileNum MyString = String$(20, "") Get #FileNum, 75, MyString MsgBox "MyString=" +MyString Close FileNum
ANSWER KEY: |
VB ONLINE: |