Results 1 to 2 of 2
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cross-Reference listing for a set of VBP files (VB6)

    How does one go about building a Cross-Reference listing for a set of VBP files?


    Examination of a *.VBP reveals multiple keys:
    <pre>Reference=
    Object=
    Module=
    Form=
    </pre>



    I could build a nice array where each row holds (in the first column) the name of the VBP source file (a text file) and (in the second column) one of the Reference, Object, Module, or Form values, suitably stripped of extraneous matter.

    It would then be a simple matter of sorting the array by, say, the second column and seeing just which source files (*.VBP) ought to be recompiled whenever a OCX or a FRM or a BAS or a DLL changes.



    It ought (with a little more work) be possible to build a path of development, that says "If you change this piece of source, you had better follow this path and recompile all the following dependent pieces too.



    It ought to be a short step from that to develop a system that can automatically recompile (in a batch session) all those modules which have been affected by a recent change or set of changes.



    Since I can edit the VBP files I could include updated revision/version numbers as I go.



    If there's anyone else out there like me staring at a slew of VBP files would like to join in, please say so.


    I have now upgraded my INI file routines to make use of classes, a simple example appears below where I MsgBox all the "Form=" keys in the unnamed section of a VBP file:



    <pre>Sub TESTFile3()
    '
    ' This TEST routine obtains all copies of the named key from the named section

    ' 1) Load a file string with data from a file
    Dim strFileData As String
    strFileData = strGetFileData("D:GreavesProductsUtilsXmaint.vbp")

    ' 2002/02/02 start
    ' The business of appending vbCRLF to the front of the file
    ' can cease once classes supersede the original code.
    '
    While Left$(strFileData, 2) = vbCrLf
    strFileData = Right$(strFileData, Len(strFileData) - 2)
    Wend
    ' 2002/02/02 end

    '''' MsgBox strFileData
    objFileString.FileStringValue = strFileData

    ' Get first occurrence of unnamed section
    objFileString.ResetFileString
    objFileString.GetNamedSection ("")
    If objFileString.L1 = 1 Then
    objSectionString.KeyStringValue = _
    Mid$(objFileString.FileStringValue, objFileString.L1, _
    objFileString.L3 - objFileString.L1 + 1)
    ' Get the first occurrence of a "Form=" key
    objSectionString.GetNamedKey ("Form")
    While objSectionString.L1 <> 0
    ' We found yet another "Form=" key in the current section.
    MsgBox Mid$(objSectionString.KeyStringValue, _
    objSectionString.L3, objSectionString.L4 - objSectionString.L3 + 1)
    objSectionString.GetNamedKey ("Form")
    Wend
    Else
    End If
    End Sub
    </pre>


  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cross-Reference listing for a set of VBP files (VB6)

    The attached DOC holds a tabular form of my results.


    ' Interim measure: dump the array to a new document for inspection.
    ' You will find that the rightmost period in the second column identifies a required file.
    Documents.Add
    Dim i As Integer
    For i = 0 To UBound(strProjects, 2)
    Selection.TypeText strProjects(0, i) & vbTab & strProjects(1, i)
    Next i
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •