home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form PinLex
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Parsing Demonstration"
- ClientHeight = 3960
- ClientLeft = 1095
- ClientTop = 1770
- ClientWidth = 6405
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 4650
- Left = 1035
- LinkTopic = "Form1"
- ScaleHeight = 3960
- ScaleWidth = 6405
- Top = 1140
- Width = 6525
- Begin VB.TextBox Text1
- Appearance = 0 'Flat
- Height = 315
- Left = 3000
- TabIndex = 2
- Top = 3060
- Width = 2775
- End
- Begin VB.CommandButton cmdNext
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Next"
- Default = -1 'True
- Height = 495
- Left = 360
- TabIndex = 1
- Top = 3120
- Width = 1335
- End
- Begin VB.ListBox List1
- Appearance = 0 'Flat
- Height = 2565
- Left = 360
- TabIndex = 0
- Top = 240
- Width = 4695
- End
- Begin MSComDlg.CommonDialog CMDialog1
- Left = 5520
- Top = 240
- _version = 65536
- _extentx = 847
- _extenty = 847
- _stockprops = 0
- cancelerror = -1 'True
- filter = "VB Modules|*.FRM;*.BAS|INI Files|*.INI"
- flags = 4100
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Manual:"
- ForeColor = &H80000008&
- Height = 255
- Left = 2100
- TabIndex = 3
- Top = 3120
- Width = 855
- End
- Begin VB.Menu mnuFile
- Caption = "File"
- End
- Attribute VB_Name = "PinLex"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim FileHandle%
- Private Sub cmdNext_Click()
- ParseALine
- End Sub
- Private Sub Form_Load()
- FileHandle% = -1
- Initialize
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- If FileHandle% >= 0 Then Close FileHandle%
- End Sub
- Private Sub mnuFile_Click()
- On Error GoTo cancelled
- cmDialog1.Action = 1
- If FileHandle% >= 0 Then
- Close #FileHandle%
- End If
- FileHandle% = FreeFile
- Open cmDialog1.filename For Input As FileHandle%
- ParseALine
- Exit Sub
- cancelled:
- Exit Sub
- End Sub
- Private Sub ParseALine()
- Dim s$, res%
- List1.Clear
- If Len(Text1.Text) > 0 Then
- s$ = Text1.Text
- Text1.Text = ""
- Else
- If FileHandle% < 0 Then
- MsgBox "File not yet open"
- Exit Sub
- End If
- If EOF(FileHandle%) Then
- List1.AddItem "End of File"
- Exit Sub
- End If
- Line Input #FileHandle%, s$
- End If
- While s$ <> ""
- List1.AddItem GetToken1(s$, res%)
- Wend
- End Sub
-