home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / amazin1a / form6.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-05  |  4.2 KB  |  138 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form Form6 
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "Reading File"
  6.    ClientHeight    =   1830
  7.    ClientLeft      =   45
  8.    ClientTop       =   375
  9.    ClientWidth     =   4365
  10.    LinkTopic       =   "Form6"
  11.    ScaleHeight     =   1830
  12.    ScaleWidth      =   4365
  13.    ShowInTaskbar   =   0   'False
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.Timer Timer1 
  16.       Interval        =   200
  17.       Left            =   3720
  18.       Top             =   1080
  19.    End
  20.    Begin VB.CommandButton Command1 
  21.       Caption         =   "Cancel"
  22.       Height          =   375
  23.       Left            =   1185
  24.       TabIndex        =   0
  25.       Top             =   1320
  26.       Width           =   1935
  27.    End
  28.    Begin MSComctlLib.ProgressBar ProgressBar1 
  29.       Height          =   375
  30.       Left            =   120
  31.       TabIndex        =   1
  32.       Top             =   840
  33.       Width           =   4095
  34.       _ExtentX        =   7223
  35.       _ExtentY        =   661
  36.       _Version        =   393216
  37.       Appearance      =   1
  38.    End
  39.    Begin VB.Label Label1 
  40.       Caption         =   "Reading :"
  41.       BeginProperty Font 
  42.          Name            =   "MS Sans Serif"
  43.          Size            =   9.75
  44.          Charset         =   0
  45.          Weight          =   700
  46.          Underline       =   0   'False
  47.          Italic          =   0   'False
  48.          Strikethrough   =   0   'False
  49.       EndProperty
  50.       Height          =   735
  51.       Left            =   120
  52.       TabIndex        =   2
  53.       Top             =   105
  54.       Width           =   4095
  55.    End
  56.    Begin VB.Shape Shape1 
  57.       BorderWidth     =   3
  58.       Height          =   1800
  59.       Left            =   10
  60.       Top             =   10
  61.       Width           =   4335
  62.    End
  63. Attribute VB_Name = "Form6"
  64. Attribute VB_GlobalNameSpace = False
  65. Attribute VB_Creatable = False
  66. Attribute VB_PredeclaredId = True
  67. Attribute VB_Exposed = False
  68. Dim FormTemp As Form5
  69. Private Sub Command1_Click()
  70. ProgressCancel = True
  71. End Sub
  72. Private Sub LoadFile()
  73.  'On Error Resume Next
  74.  Dim file1, textline As String, strtemp As String, pos As Long
  75.  file1 = FreeFile
  76.  ProgressBar1.Max = FileLen(FileFSToOpen)
  77.  pos = 0
  78.  Open FileFSToOpen For Input As file1
  79.   Do While Not EOF(file1) ' Loop until end of file.
  80.     If ProgressCancel Then Exit Do
  81.     Line Input #file1, textline ' Read line into variable.
  82.     textline = textline & Chr(13) & Chr(10)
  83.     FormTemp.Text1.Text = FormTemp.Text1.Text & textline & Chr(13) & Chr(10)
  84.         ProgressBar1.Value = ProgressBar1.Value + Len(textline)
  85.     DoEvents
  86.     pos = pos + Len(textline)
  87.   Loop
  88. Close #file1
  89. End Sub
  90. Private Sub LoadFunction()
  91.  Dim EndStatement As String, file1
  92.  file1 = FreeFile
  93.  EndStatement = "End Sub"
  94.  If InStr(1, StringToFind, "Function") <> 0 Then EndStatement = "End Function"
  95.  ProgressBar1.Max = FileLen(FileFSToOpen)
  96.  Open FileFSToOpen For Input As file1
  97.   Dim textline
  98.   Do While Not EOF(file1) ' Loop until end of file.
  99.     If ProgressCancel Then Exit Do
  100.     Line Input #file1, textline ' Read line into variable.
  101.     If InStr(1, textline, StringToFind, vbTextCompare) <> 0 Then
  102.       FormTemp.Text1.Text = FormTemp.Text1.Text & textline & Chr(13) & Chr(10)
  103.       Do
  104.         Line Input #file1, textline ' Read line into variable.
  105.         FormTemp.Text1.Text = FormTemp.Text1.Text & textline & Chr(13) & Chr(10)
  106.         If Trim(textline) = EndStatement Then Close file1: Exit Sub
  107.       Loop
  108.     ProgressBar1.Value = ProgressBar1.Value + Len(textline)
  109.     DoEvents
  110.     End If
  111.     ProgressBar1.Value = ProgressBar1.Value + Len(textline)
  112.     DoEvents
  113.   Loop
  114.  Close file1
  115. End Sub
  116. Private Sub Form_Load()
  117. Set FormTemp = New Form5
  118. ProgressBar1.Value = 0
  119. ProgressCancel = False
  120. Top = Form1.Top + ((Form1.Height / 2)) - (Height / 2)
  121. Left = (Form1.Left + (Form1.Width / 2)) - (Width / 2)
  122. Label1.Caption = "Reading :" & FileFSToOpen
  123. End Sub
  124. Private Sub Form_Paint()
  125. Timer1.Enabled = True
  126. End Sub
  127. Private Sub Timer1_Timer()
  128. Timer1.Enabled = False
  129. If TypeView = 0 Then
  130.  LoadFunction
  131.  Unload Me
  132.  FormTemp.Show
  133.  LoadFile
  134.  Unload Me
  135.  FormTemp.Show
  136. End If
  137. End Sub
  138.