home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / VISBASIC / READFRMS / FORM1.FRM next >
Text File  |  1994-12-15  |  6KB  |  242 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "ReadForms"
  5.    ClientHeight    =   4365
  6.    ClientLeft      =   3720
  7.    ClientTop       =   2235
  8.    ClientWidth     =   5625
  9.    Height          =   5055
  10.    Icon            =   FORM1.FRX:0000
  11.    Left            =   3660
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   4365
  15.    ScaleWidth      =   5625
  16.    Top             =   1605
  17.    Width           =   5745
  18.    Begin Frame Frame1 
  19.       BackColor       =   &H00C0C0C0&
  20.       Caption         =   "Send output to:"
  21.       ForeColor       =   &H00FF0000&
  22.       Height          =   1095
  23.       Left            =   2880
  24.       TabIndex        =   6
  25.       Top             =   1320
  26.       Width           =   2535
  27.       Begin SSOption Option3D2 
  28.          Caption         =   "Word for Windows"
  29.          Height          =   255
  30.          Left            =   240
  31.          TabIndex        =   8
  32.          TabStop         =   0   'False
  33.          Top             =   720
  34.          Width           =   1815
  35.       End
  36.       Begin SSOption Option3D1 
  37.          Caption         =   "Windows 'Write'"
  38.          Height          =   255
  39.          Left            =   240
  40.          TabIndex        =   7
  41.          Top             =   360
  42.          Value           =   -1  'True
  43.          Width           =   1935
  44.       End
  45.    End
  46.    Begin DirListBox Dir1 
  47.       Height          =   2730
  48.       Left            =   240
  49.       TabIndex        =   3
  50.       Top             =   1320
  51.       Width           =   2175
  52.    End
  53.    Begin DriveListBox Drive1 
  54.       Height          =   315
  55.       Left            =   240
  56.       TabIndex        =   2
  57.       Top             =   960
  58.       Width           =   2175
  59.    End
  60.    Begin CommandButton Command3 
  61.       BackColor       =   &H00C0C0C0&
  62.       Caption         =   "Exit"
  63.       Height          =   495
  64.       Left            =   3720
  65.       TabIndex        =   1
  66.       Top             =   3720
  67.       Width           =   1695
  68.    End
  69.    Begin Timer Timer1 
  70.       Enabled         =   0   'False
  71.       Interval        =   2000
  72.       Left            =   3000
  73.       Top             =   3960
  74.    End
  75.    Begin CommandButton Command2 
  76.       BackColor       =   &H00C0C0C0&
  77.       Caption         =   "Get .FRM Files"
  78.       Height          =   615
  79.       Left            =   3720
  80.       TabIndex        =   0
  81.       Top             =   3000
  82.       Width           =   1695
  83.    End
  84.    Begin Timer Timer2 
  85.       Enabled         =   0   'False
  86.       Interval        =   2000
  87.       Left            =   2520
  88.       Top             =   3960
  89.    End
  90.    Begin Label Label2 
  91.       BackColor       =   &H00C0C0C0&
  92.       Caption         =   "Selected directory:"
  93.       FontBold        =   -1  'True
  94.       FontItalic      =   0   'False
  95.       FontName        =   "MS Sans Serif"
  96.       FontSize        =   9.75
  97.       FontStrikethru  =   0   'False
  98.       FontUnderline   =   0   'False
  99.       ForeColor       =   &H00FF0000&
  100.       Height          =   255
  101.       Left            =   240
  102.       TabIndex        =   5
  103.       Top             =   120
  104.       Width           =   2415
  105.    End
  106.    Begin Label Label1 
  107.       BackColor       =   &H00C0C0C0&
  108.       BorderStyle     =   1  'Fixed Single
  109.       FontBold        =   -1  'True
  110.       FontItalic      =   0   'False
  111.       FontName        =   "MS Sans Serif"
  112.       FontSize        =   9.75
  113.       FontStrikethru  =   0   'False
  114.       FontUnderline   =   0   'False
  115.       ForeColor       =   &H000000C0&
  116.       Height          =   255
  117.       Left            =   240
  118.       TabIndex        =   4
  119.       Top             =   480
  120.       Width           =   5175
  121.    End
  122.    Begin Menu help 
  123.       Caption         =   "&Help"
  124.       Begin Menu what 
  125.          Caption         =   "&What it does"
  126.       End
  127.       Begin Menu about 
  128.          Caption         =   "&About"
  129.       End
  130.    End
  131. End
  132.  
  133. Sub about_Click ()
  134. form3.Show
  135. End Sub
  136.  
  137. Sub Command2_Click ()
  138.  
  139. screen.MousePointer = 11
  140.  
  141. 'build a batch file containing the path of the files to be read....
  142. Open "c:\readfrms.bat" For Output As #1
  143. Print #1, Left$(Dir1.Path, 1) & ":"
  144. len1 = Len(Dir1.Path) - 3
  145. Print #1, "cd\" & Right$(Dir1.Path, len1)
  146. Print #1, "dir *.frm /s /b > c:\readfrms.wrk"
  147. Print #1, "del c:\control.xxx"
  148. Print #1, "del c:\readfrms.bat"
  149. Close #1
  150.  
  151. 'wait a couple of seconds for the batch file to be written....
  152. timer2.Enabled = True
  153.  
  154. End Sub
  155.  
  156. Sub Command3_Click ()
  157. End
  158. End Sub
  159.  
  160. Sub Dir1_Change ()
  161. Label1.Caption = Dir1.Path
  162. End Sub
  163.  
  164. Sub Drive1_Change ()
  165. Dir1.Path = Drive1.Drive
  166. End Sub
  167.  
  168. Sub Form_Activate ()
  169. screen.MousePointer = 0
  170. End Sub
  171.  
  172. Sub Form_Load ()
  173. screen.MousePointer = 11
  174. newpath = app.Path
  175. If Right$(newpath, 1) = "\" Then newpath = Left$(newpath, (Len(newpath) - 1))
  176. form1.Drive1.Drive = "c:\"
  177. form1.Dir1.Path = "c:\"
  178. form1.Label1.Caption = Dir1.Path
  179. Left = (screen.Width - Width) / 2
  180. Top = (screen.Height - Height) / 6
  181. End Sub
  182.  
  183. Sub Timer1_Timer ()
  184.  
  185. dirtext = Dir$("c:\control.xxx")
  186.  
  187. 'Check to see if CONTROL.XXX has been deleted yet....
  188. If dirtext = "" Then
  189.     timer1.Enabled = False
  190.     Open newpath & "\temp.tmp" For Output As #3
  191.     Open "c:\readfrms.wrk" For Input As #1
  192.     
  193.     Do Until EOF(1)
  194.         Line Input #1, fileline
  195.         Open fileline For Input As #2
  196.         Do Until EOF(2)
  197.             Line Input #2, lines
  198.             If Left$(lines, 4) = "Sub " Then
  199.                 Print #3, "***************** " & fileline & " *****************"
  200.                 Print #3, lines
  201.                 
  202.                 Do Until EOF(2)
  203.                     Line Input #2, lines
  204.                     Print #3, lines
  205.                 Loop
  206.             End If
  207.         Loop
  208.         Close #2
  209.     Loop
  210.     
  211.     Close
  212.     screen.MousePointer = 0
  213.     Kill "c:\readfrms.wrk"
  214.     screen.MousePointer = 0
  215.     
  216.     If form1.Option3D2.Value = True Then
  217.         x = Shell("c:\winword6\winword.exe " & newpath & "\temp.tmp", 3)
  218.         Else x = Shell("write.exe " & newpath & "\temp.tmp", 3)
  219.     End If
  220.     End
  221. End If
  222. End Sub
  223.  
  224. Sub Timer2_Timer ()
  225.  
  226. timer2.Enabled = False
  227. screen.MousePointer = 11
  228. timer1.Enabled = True
  229.  
  230. 'create a temp file that gets deleted after READFRMS.WRK has finished....
  231. Open "c:\control.xxx" For Output As #1
  232. Close #1
  233.  
  234. x = Shell(newpath & "\readfrms.pif")
  235.  
  236. End Sub
  237.  
  238. Sub what_Click ()
  239. form2.Show
  240. End Sub
  241.  
  242.