home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form HelpScrn
- BackColor = &H00C0C0C0&
- Caption = "Help Screen"
- ClientHeight = 4200
- ClientLeft = 975
- ClientTop = 2100
- ClientWidth = 7575
- Height = 4605
- Icon = HELPSCRN.FRX:0000
- Left = 915
- LinkTopic = "Form1"
- ScaleHeight = 4200
- ScaleWidth = 7575
- Top = 1755
- Width = 7695
- Begin TextBox HoldBox
- Height = 285
- Left = 480
- MultiLine = -1 'True
- TabIndex = 4
- Text = "Text1"
- Top = 240
- Visible = 0 'False
- Width = 1095
- End
- Begin ComboBox HelpTopic
- Height = 300
- Left = 3120
- TabIndex = 0
- Text = " "
- Top = 120
- Width = 4215
- End
- Begin CommandButton PrintHelp
- Caption = "&Print Topic"
- Height = 375
- Left = 5760
- TabIndex = 2
- Top = 3720
- Width = 1575
- End
- Begin CommandButton Return
- Caption = "&Exit Help"
- Height = 375
- Left = 240
- TabIndex = 1
- Top = 3720
- Width = 1215
- End
- Begin TextBox DisplayHelp
- Height = 3015
- Left = 240
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 3
- TabStop = 0 'False
- Text = " "
- Top = 600
- Width = 7095
- End
- ' Helpscreen is a FREEWARE product. While it is
- ' copywritten, you are encouraged to share it as
- ' long as you do not remove this message.
- ' HELPSCREEN written by Ed Crygier (C)opyright 1992
- ' Requires Visual Basic version 2.0 to incorporate
- ' in your program or VBRUN200.DLL to use as a stand
- ' alone program.
- ' Version 1.1
- Const MaxTopics = 100
- Const MaxLines = 55
- Dim IndexTopic(MaxTopics)
- Dim HelpTexT(MaxTopics, MaxLines)
- Sub Form_Load ()
- 'pass parameter 'HelpItem' to this program to make it text sensitive
- NL$ = Chr$(13) + Chr$(10) 'sets a carraige return
- TopicNbr = 0 ' initialize
- FileNum = FreeFile ' find the next free file
- Open "HelpFile.Txt" For Input As FileNum 'the help text
- ReadARecord:
- If EOF(FileNum) Then GoTo LeaveHere
- TopicNbr = TopicNbr + 1: LineNbr = 0
- If TopicNbr > MaxTopics Then Close #FileNum: Exit Sub
- Line Input #FileNum, IndexTopic(TopicNbr)
- HelpTopic.AddItem IndexTopic(TopicNbr)
- MoreLines:
- LineNbr = LineNbr + 1
- If LineNbr > MaxLines Then
- MsgBox "Number of lines exceeds 55 for Topic " + IndexTopic(TopicNbr) + ". Add a '#' sign at line 55."
- GoTo ReadARecord
- End If
- Line Input #FileNum, HelpTexT(TopicNbr, LineNbr)
- If LTrim$(Left$(HelpTexT(TopicNbr, LineNbr), 1)) = "#" Then
- GoTo ReadARecord
- Else
- HelpTexT(TopicNbr, LineNbr) = HelpTexT(TopicNbr, LineNbr) + NL$
- GoTo MoreLines
- End If
- LeaveHere:
- Close #FileNum
- If (Val(HelpItem - 1 >= 0)) And (Val(HelpItem - 1 <= TopicNbr)) Then
- HelpTopic.ListIndex = Str(HelpItem - 1)
- Else
- HelpTopic.ListIndex = 0
- End If
- End Sub
- Sub HelpTopic_Click ()
- ShowIt
- End Sub
- Sub PrintHelp_Click ()
- X = MsgBox("Insure printer is turned on. OK to continue?", 36, "Print Topic")
- If X = 6 Then
- Printer.Print IndexTopic(HelpTopic.ListIndex + 1)
- Printer.Print DisplayHelp.Text
- Printer.NewPage
- Printer.EndDoc
- End If
- End Sub
- Sub Return_Click ()
- Erase IndexTopic
- Erase HelpTexT
- Unload HelpScrn
- End Sub
- Sub ShowIt ()
- y = HelpTopic.ListIndex + 1
- z = 0
- DisplayHelp.Text = "": HoldBox.Text = ""
- ReadALine:
- z = z + 1
- If LTrim$(Left$(HelpTexT(y, z), 1)) = "#" Then
- DisplayHelp.Text = HoldBox.Text
- Exit Sub
- End If
- HoldBox.Text = HoldBox.Text + HelpTexT(y, z)
- GoTo ReadALine
- End Sub
-