home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
PROGRAM
/
VISBASIC
/
READFRMS
/
FORM1.FRM
next >
Wrap
Text File
|
1994-12-15
|
6KB
|
242 lines
VERSION 2.00
Begin Form Form1
BackColor = &H00C0C0C0&
Caption = "ReadForms"
ClientHeight = 4365
ClientLeft = 3720
ClientTop = 2235
ClientWidth = 5625
Height = 5055
Icon = FORM1.FRX:0000
Left = 3660
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4365
ScaleWidth = 5625
Top = 1605
Width = 5745
Begin Frame Frame1
BackColor = &H00C0C0C0&
Caption = "Send output to:"
ForeColor = &H00FF0000&
Height = 1095
Left = 2880
TabIndex = 6
Top = 1320
Width = 2535
Begin SSOption Option3D2
Caption = "Word for Windows"
Height = 255
Left = 240
TabIndex = 8
TabStop = 0 'False
Top = 720
Width = 1815
End
Begin SSOption Option3D1
Caption = "Windows 'Write'"
Height = 255
Left = 240
TabIndex = 7
Top = 360
Value = -1 'True
Width = 1935
End
End
Begin DirListBox Dir1
Height = 2730
Left = 240
TabIndex = 3
Top = 1320
Width = 2175
End
Begin DriveListBox Drive1
Height = 315
Left = 240
TabIndex = 2
Top = 960
Width = 2175
End
Begin CommandButton Command3
BackColor = &H00C0C0C0&
Caption = "Exit"
Height = 495
Left = 3720
TabIndex = 1
Top = 3720
Width = 1695
End
Begin Timer Timer1
Enabled = 0 'False
Interval = 2000
Left = 3000
Top = 3960
End
Begin CommandButton Command2
BackColor = &H00C0C0C0&
Caption = "Get .FRM Files"
Height = 615
Left = 3720
TabIndex = 0
Top = 3000
Width = 1695
End
Begin Timer Timer2
Enabled = 0 'False
Interval = 2000
Left = 2520
Top = 3960
End
Begin Label Label2
BackColor = &H00C0C0C0&
Caption = "Selected directory:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00FF0000&
Height = 255
Left = 240
TabIndex = 5
Top = 120
Width = 2415
End
Begin Label Label1
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H000000C0&
Height = 255
Left = 240
TabIndex = 4
Top = 480
Width = 5175
End
Begin Menu help
Caption = "&Help"
Begin Menu what
Caption = "&What it does"
End
Begin Menu about
Caption = "&About"
End
End
End
Sub about_Click ()
form3.Show
End Sub
Sub Command2_Click ()
screen.MousePointer = 11
'build a batch file containing the path of the files to be read....
Open "c:\readfrms.bat" For Output As #1
Print #1, Left$(Dir1.Path, 1) & ":"
len1 = Len(Dir1.Path) - 3
Print #1, "cd\" & Right$(Dir1.Path, len1)
Print #1, "dir *.frm /s /b > c:\readfrms.wrk"
Print #1, "del c:\control.xxx"
Print #1, "del c:\readfrms.bat"
Close #1
'wait a couple of seconds for the batch file to be written....
timer2.Enabled = True
End Sub
Sub Command3_Click ()
End
End Sub
Sub Dir1_Change ()
Label1.Caption = Dir1.Path
End Sub
Sub Drive1_Change ()
Dir1.Path = Drive1.Drive
End Sub
Sub Form_Activate ()
screen.MousePointer = 0
End Sub
Sub Form_Load ()
screen.MousePointer = 11
newpath = app.Path
If Right$(newpath, 1) = "\" Then newpath = Left$(newpath, (Len(newpath) - 1))
form1.Drive1.Drive = "c:\"
form1.Dir1.Path = "c:\"
form1.Label1.Caption = Dir1.Path
Left = (screen.Width - Width) / 2
Top = (screen.Height - Height) / 6
End Sub
Sub Timer1_Timer ()
dirtext = Dir$("c:\control.xxx")
'Check to see if CONTROL.XXX has been deleted yet....
If dirtext = "" Then
timer1.Enabled = False
Open newpath & "\temp.tmp" For Output As #3
Open "c:\readfrms.wrk" For Input As #1
Do Until EOF(1)
Line Input #1, fileline
Open fileline For Input As #2
Do Until EOF(2)
Line Input #2, lines
If Left$(lines, 4) = "Sub " Then
Print #3, "***************** " & fileline & " *****************"
Print #3, lines
Do Until EOF(2)
Line Input #2, lines
Print #3, lines
Loop
End If
Loop
Close #2
Loop
Close
screen.MousePointer = 0
Kill "c:\readfrms.wrk"
screen.MousePointer = 0
If form1.Option3D2.Value = True Then
x = Shell("c:\winword6\winword.exe " & newpath & "\temp.tmp", 3)
Else x = Shell("write.exe " & newpath & "\temp.tmp", 3)
End If
End
End If
End Sub
Sub Timer2_Timer ()
timer2.Enabled = False
screen.MousePointer = 11
timer1.Enabled = True
'create a temp file that gets deleted after READFRMS.WRK has finished....
Open "c:\control.xxx" For Output As #1
Close #1
x = Shell(newpath & "\readfrms.pif")
End Sub
Sub what_Click ()
form2.Show
End Sub