home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmPhone
- Caption = "Phone Number"
- ClientHeight = 1725
- ClientLeft = 1215
- ClientTop = 1650
- ClientWidth = 2655
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 1725
- ScaleWidth = 2655
- Begin VB.TextBox txtName
- Height = 285
- Left = 1680
- TabIndex = 1
- Top = 120
- Width = 855
- End
- Begin VB.PictureBox picNumber
- Height = 255
- Left = 120
- ScaleHeight = 195
- ScaleWidth = 2355
- TabIndex = 3
- Top = 1320
- Width = 2415
- End
- Begin VB.CommandButton cmdDisplay
- Caption = "Display Phone Number"
- Height = 495
- Left = 120
- TabIndex = 2
- Top = 600
- Width = 2415
- End
- Begin VB.Label lblName
- Alignment = 1 'Right Justify
- Caption = "Name to look up"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 1455
- End
- Attribute VB_Name = "frmPhone"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdDisplay_Click()
- Dim foundFlag As Boolean, fileName As String
- Dim nom As String, phoneNum As String
- Open App.Path & "\LISTS.TXT" For Input As #1
- foundFlag = False
- nom = ""
- Do While (foundFlag = False) And (Not EOF(1))
- Input #1, fileName
- Open App.Path & "\" & fileName For Input As #2
- Do While (nom <> txtName.Text) And (Not EOF(2))
- Input #2, nom, phoneNum
- Loop
- Close #2
- picNumber.Cls
- If nom = txtName.Text Then
- picNumber.Print nom, phoneNum
- foundFlag = True
- End If
- Loop
- Close #1
- If foundFlag = False Then
- picNumber.Print "Name not found."
- End If
- End Sub
-