'***This script places the contents of $HEADER\docHeader.txt in the 'documentation fields of all module specifictions in the model, which 'means it will be produced near the top of each header file in the 'generated code 'Possible changes: perform only on selected modules, do for specifications 'and bodies, preserve existing doc field contents by parsing 'GetActualPath returns the parameter if it fails; this returns a blank Function GetActualPathEx (inVirtual As String) As String GetActualPathEx = "" ret$ = RoseApp.PathMap.GetActualPath(inVirtual) If ret$ <> inVirtual Then GetActualPathEx = ret$ End If End Function Sub Main Dim theMods As ModuleCollection Dim aMod As Module 'file with header text is stored in dir specified by path map $HEADER path$ = GetActualPathEx("$HEADER") If path$ = "" Then MsgBox "$HEADER not defined" Exit Sub End If 'file is named docHeader.txt - append to path fileName$ = path$ + "\docHeader.txt" Open fileName$ For Input As #1 'stick text in docHeader$ variable Input #1, docHeader$ Close #1 'iterate through all modules Set theMods = RoseApp.CurrentModel.GetAllModules() 'or, iterate through selected modules 'Set theMods = RoseApp.CurrentModel.GetSelectedModules() For i% = 1 To theMods.Count Set aMod = theMods.GetAt(i%) 'only place header text in header files If aMod.Part = "Specification" Then 'this is dumb; should not wipe out other stuff in doc field aMod.Documentation = docHeader$ End If Next i MsgBox "Done" End Sub