home *** CD-ROM | disk | FTP | other *** search
- Const FILEBOXCLICK = 0, DIRSBOXCLICK = 1
- Dim lastchange As Integer
-
- Sub FormatFile (FileToFormat$)
-
- EOL$ = Chr$(13) + Chr$(10)
- Footer$ = " PFF - Programmer's File Formatter Copyright 1989-91, AmSoft Development"
- ReDim A$(110)
- PageNum = 1
- TotalLines = 0
- Open FileToFormat$ For Input As #100 Len = 2048
- plc = 1
- While Not EOF(100)
- Header$ = " Page -" + Str$(PageNum) + " " + Date$ + Space$(20) + " File: " + FileToFormat$
- Printer.FontName = "Courier 10 Pitch"
- Printer.FontSize = 12
- Printer.Print Header$
- For q = 1 To 2: Printer.Print : Next q
- Printer.FontName = "Courier 20 Pitch"
- Printer.FontSize = 6
- For plc = 1 To 108
- If EOF(100) GoTo EndOfFile
- Line Input #100, A$(plc)
- j% = Len(A$(plc))
- If j% = 1 And A$(plc) < " " Then
- A$(plc) = " "
- GoTo SendFF
- End If
- For count = 1 To j%
- junk$ = Mid$(A$(plc), count, 1)
- If junk$ = Chr$(12) Then
- A$(plc) = Left$(A$(plc), count - 1)
- End If
- Next count
-
- SendFF:
-
- Printer.Print Space$(8);
- If LINES Then
- Num$ = Space$(4 - Len(Str$(plc + (108 * (PageNum - 1))))) + Str$(plc + (108 * (PageNum - 1))) + " "
- Printer.Print Num$;
- End If
- A$(plc) = A$(plc)
- Printer.Print A$(plc)
- TotalLines = TotalLines + 1
- Next plc
-
- EndOfFile:
-
-
- If Not EOF(100) Then
- Printer.FontName = "Courier 10 Pitch"
- Printer.FontSize = 12
- Printer.Print : Printer.Print Footer$
- Printer.NewPage
- PageNum = PageNum + 1
- Else
- For count = plc To 108
- Printer.Print
- Next count
- Printer.FontName = "Courier 10 Pitch"
- Printer.FontSize = 12
- Printer.Print : Printer.Print : Printer.Print Footer$
- Printer.NewPage
- End If
- Wend
- Printer.EndDoc
- Close #100
- Close #200
- Erase A$
-
- End Sub
-
- Sub GetDefaults ()
- On Error GoTo GD_ErrHandle ' Turn on error handling
- Open "callhelp.ini" For Input As #1 ' Open INI data file
- Input #1, HelpFile$, KeyTable$ ' Read data into variables
- Input #1, L%, T% ' Read data for location
- Close #1 ' Close data file
- ' Text1.Text = HelpFile$ ' Set File Name box
- ' KwdTableBox.Text = KeyTable$ ' Set Multikey table box
- Left = L%
- Top = T%
-
- GD_ErrHandle:
- Selection.Caption = "No Help File"
- Resume GD_Done
- GD_Done:
- End Sub
-
- Sub Main ()
-
- Load About
- About.Show MODAL
- Load Selection
- Load Viewer
- LINES = True
- Viewer.Display.Move 100, 446, Viewer.ScaleWidth - 200, Viewer.ScaleHeight - 546
-
- End Sub
-
-