home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Nodes
- BackColor = &H00FFFF00&
- Caption = "Node Finder"
- ClientHeight = 4035
- ClientLeft = 8445
- ClientTop = 4560
- ClientWidth = 3030
- Height = 4440
- Left = 8385
- LinkTopic = "Form1"
- ScaleHeight = 4035
- ScaleWidth = 3030
- Top = 4215
- Width = 3150
- Begin TextBox Text1
- Height = 285
- Left = 1020
- MaxLength = 3
- TabIndex = 1
- Top = 60
- Width = 795
- End
- Begin Grid Grid1
- FixedCols = 0
- Height = 3630
- Left = 30
- Rows = 15
- ScrollBars = 0 'None
- TabIndex = 0
- Top = 390
- Width = 2970
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Search :"
- Height = 225
- Left = 75
- TabIndex = 2
- Top = 90
- Width = 780
- End
- 'Database vars
- Dim MyDBF As database
- Dim NodesTB As Table
- Sub Form_Load ()
- 'Open File
- Set MyDBF = OpenDatabase(App.path, False, False, "dBase III")
- Set NodesTB = MyDBF.OpenTable("nodefind")
- NodesTB.Index = "id"
- 'Set Grid properties
- Grid1.ColWidth(0) = 180 * 3
- Grid1.ColWidth(1) = 180 * 13.2
- Grd_Write Grid1, 0, 0, "Code"
- Grd_Write Grid1, 0, 1, "Location"
- 'Fill Grid and bookmark (MARK) array for the first time
- For i = Grid1.FixedRows To Grid1.Rows - Grid1.FixedRows
- Grd_Write Grid1, i, 0, NodesTB(0)
- Grd_Write Grid1, i, 1, NodesTB(1)
- Mark(1, i) = NodesTB.Bookmark
- NodesTB.MoveNext
- Grid1.Row = 1
- End Sub
- Sub Grid1_KeyDown (KeyCode As Integer, Shift As Integer)
- 'Call the browse sub
- 'Pay atention to the parameters
- 'Watch the Grid1_SelChange sub
- Grid_Browse KeyCode, Shift, Grid1, NodesTB, 1
- End Sub
- Sub Grid1_SelChange ()
- 'Highlight an grid row
- Grid1.SelStartCol = 0
- Grid1.SelEndCol = 1
- End Sub
- Sub Text1_Change ()
- Dim CurRow As Integer
- CurRow = Grid1.Row
- NodesTB.Seek ">=", UCase(Left$(Text1.Text, 3))
- If Not NodesTB.NoMatch Then
- 'Refresh grid and bookmark array data
- For r = Grid1.FixedRows To Grid1.Rows - 1
- For c = Grid1.FixedCols To Grid1.Cols - 1
- Grd_Write Grid1, r, c, NodesTB(c - Grid1.FixedCols)
- Next
- Mark(1, r) = NodesTB.Bookmark
- NodesTB.MoveNext
- Next
- 'Put the cursor on the first grid line
- Grid1.Row = CurRow
- End If
- End Sub
- Sub Text1_GotFocus ()
- 'Highlight entire text
- Text1.SelStart = 0
- Text1.SelLength = Len(Text1.Text)
- End Sub
-