Tutorial 6 A,B,C Tutorial 7 A,B,C Tutorial 8 A Review of Sequential Access Files can only read OR write variable length records open "a:\file.txt" for Append as 1 write #1, txtCityName.text, txtZipCode.text print #1, txtCityName.text, txtZipCode.text close 1 open "a:\file.txt" for Input as 1 input #1, strCityName, strZipCode Modes for opening SAF Append - creates if it doesn't exist add to the end of the file Output - creates if it doesn't exist deletes if it does exist Input - reads from a file causes error if doesn't exist Random Access Files Can read and write to file Fixed length records open "a:\test.txt" for Random As 1 Len = 10 open "a:\test.txt" for Random As 1 Len = Len(udtItemRec) Put #1, intRecNum, udtItemRec used for writing to a file Get #1, intRecNum, udtItemRec used for reading from a file Close #1 User Defined Type Like a collection of fields Must be defined in a code module String Manipulation - see lecture notes Dialog Boxes CancelError property ShowColor ShowSave ShowFont ShowPrinter ShowOpen Flags property Filename Filter each filter is two parts separated by | First part is for user, appears in dropdown Second part used by program, specific syntax .Filter = "All Files | *.*" additional filters separated by | .Filter = "Text Files (*.txt) | *.txt | All Files | *.*" Error Trapping Public Sub cmdOpen_Click() On Error Goto cmdOpen_Err Exit Sub cmdOpen_Err: End Sub