Compares the project file to a given source file. A stand-alone project file for the given source file will be returned. If a translation unit of the calling project file matches a translation unit in the given source file the corresponding translation unit node numbers are stored in the same index in the arrays.

Syntax:

CompareSourceFiles(SourceFileName As String, ImportAlsoSameAsSource As Boolean, 
TransUnitNodeNumberArray1 As Variant, TransUnitNodeNumberArray2 As Variant) As ProjectFile
Return: ProjectFile
Parameters: SourceFileName Name and path of the source file to be compared.
ImportAlsoSameAsSource If True also translation with same source and target text will be considered.
TransUnitNodeNumberArray1 Array with node numbers of translation units belonging to the calling project file.
TransUnitNodeNumberArray2 Array with node numbers of translation units belonging to the given project file.

Example:
Dim ProjFile As ProjectFile
Dim NewProjFile As ProjectFile
Dim TUNodeNoAry1() As Variant
Dim TUNodeNoAry2() As Variant
Dim TU As TransUnit
Dim NewTU As TransUnit
Dim i As Integer

Set ProjFile = Application.ActiveProjectFile
Set NewProjFile = ProjFile.CompareSourceFiles("C:\SampleFiles\java\TargetFiles_fr\Test.properties", _
    True, TUNodeNoAry1, TUNodeNoAry2)

If Not (NewProjFile Is Nothing) Then
    For i = LBound(TUNodeNoAry1) To UBound(TUNodeNoAry1)
        Set TU = ProjFile.GetTransUnit(TUNodeNoAry1(i))
        Set NewTU = NewProjFile.GetTransUnit(TUNodeNoAry2(i))
        TU.Target = NewTU.Source
    Next i
End If


See also:

Class ProjectFile


Last Updated: 01/19/06