Printing random access file
If I have a random access file that contains a record at 1 and a record at 100 how do I code the application so only record 1 and record 100 print without 98 rows of squares representing the "nulls" in between? Following is the print code I am currently using:
VB Code:
Private Sub cmdPrint_Click()
Dim strFont As String, sngSize As Single
Dim strPS1 As String * 10, strPS2 As String * 30, strPS3 As String * 1
Dim intX As Integer
strFont = Printer.Font
sngSize = Printer.FontSize
Printer.Font = "courier new"
Printer.FontSize = 10
Printer.Print Tab(35); "Student Grades"
Printer.Print
Printer.Print
Printer.Print Tab(5); "Student Number"; Tab(30); "Student Name"; Tab(70); "Grade"
Printer.Print
intX = 1
Do While Not EOF(1)
Get #1, intX, udtStuRec
strPS1 = udtStuRec.strStuNum
strPS2 = udtStuRec.strStuName
strPS3 = udtStuRec.strGrade
Printer.Print Tab(5); strPS1; Tab(30); strPS2; Tab(70); strPS3
intX = intX + 1
Get #1, intX, udtStuRec 'reads next record
Loop
Printer.Print
Printer.Print
Printer.Print Tab(5); "End of report"
Printer.EndDoc
Printer.Font = strFont
Printer.FontSize = sngSize
End Sub
Thanks,
Wayne