English 中文(简体)
4. 多重卷宗的处理方式
原标题:pattern match processing of multiple .frm files

我有多个VB6<代码>.frm文档。 见下文。 我想要从法典中删除职能和子,只留下形式设计。

我需要做的是从“Attribute”开始的最后一行,因为在这条线之后,应当进一步删除所有的内容。

利用配对方式或类似方式,我如何处理<代码>.frm的文档,以便最后文本之后的所有文件都能查阅。 沥青线被删除? 如果我正在通过档案进行追踪,那么我怎么能够告诉最后一条直线在哪里?

<代码>.frm文档:

VERSION 5.00
Begin VB.Form Form1
    Caption = "Form1"
    ClientHeight = 3195
    ClientLeft = 60
    ClientTop = 345
    ClientWidth = 4680
    LinkTopic = "Form1"
    ScaleHeight = 3195
    ScaleWidth = 4680
    StartUpPosition = 3  Windows Default
    Begin VB.CommandButton Command1
        Caption = "Command1"
        Height = 495
        Left = 1800
        TabIndex = 1
        Top = 1320
        Width = 1215
    End
    Begin VB.TextBox Text1
        Height = 495
        Left = 360
        TabIndex = 0
        Text = "Text1"
        Top = 240
        Width = 1215
    End
End

Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
    Text1.Text = "Hello World"
End Sub
Private Sub Form_Load()
    Text1.BackColor = vbBlue
End 
最佳回答

仅需要2条规则:

1) If line starts with Attribute then don t delete. 2) If line starts with Attribute set a flag to start deleting all subsequent lines.

Rule #1 will prevent you from deleting subsequent Attribute lines, and there should be nothing you want to keep after the first Attribute you encounter unless it s an Attribute.

问题回答

暂无回答




相关问题
Prevent windows from queuing shellexecute requests

Win.ShellExecute 0, "open", "C:dirprogram.exe", "arguments", vbNullString, SW_SHOWNORMAL Win.ShellExecute 0, "open", "http://www.google.com", vbNullString, vbNullString, SW_SHOWNORMAL I want google....

Why is My Loop Only Deleting One File?

Using VB6 In a folder, i have n number of files, i want to delete a 0 kb files code Dim filename5 As String filename5 = Dir$(txtsourcedatabasefile & "*_*", vbDirectory) MsgBox filename5 Do ...

How to check the filesize?

Using VB6 I have the text file with different sizes, so i want to delete the file where filesize = 0 kb. How to make a vb6 code for deleting the 0 kb files. Need vb6 code Help

File Rename problem?

I m using VB6 and I have a folder where I have n number of files. I want to change the file extension to .txt. I used the code below to change the extension of all .fin files to .txt. Dim filename1 ...

Error 20728-F while in using Crystal Reports in VB6

I m using Crystal Reports in my VB6 project, but I m facing error while loading the report in crystalreport1.action=1; Please give me some solution for this problem. It is showing the error as Error ...

DllRegisterServer entry point was not found

When running my vb6 application I am getting error like, runtime error 53 : file not found: rscomclNoMsg.dll then i tried to register that dll from cmd line using regsvr32. Then I am getting ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

热门标签