Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#7 Insensitive Sections {Todo|bug|history}

open
nobody
None
5
2012-08-15
2012-08-15
Anonymous
No

Suggested fix to allow insensitive comparison when printing lists of TODO|HISTORY|BUG

============= Description of fix
Before: the section names {todo|history|bug} must use exact case (actually, in lower case)
After: the section names {todo|history|bug} can use mixed case.
Tested: only on VB6/VBA code using JavaDoc
Changes tagged as : [irm:120815]

============= [In : VBCLSLIB.clsDictionnary.exists()]

'@history [IRM:120815] Implemented optional parameter for insensitive comparison
Public Function exists(ByVal key As String, Optional caseMode As Boolean = false) As Boolean

''
' Returns True if a specified key exists in the dictionary object,
' False if it does not.
'
' @param key Key value being searched for in the dictionary object
' @history [irm:120815] Implemented optional parameter for insensitive comparision

Public Function exists(ByVal key As String, Optional caseMode As Boolean = True) As Boolean
Dim k As Variant
If caseMode Then key = LCase(key)
For Each k In colKeys
If 0 = IIf(caseMode, StrComp(LCase(k), key), StrComp(k, key)) Then
exists = True
Exit Function
End If
Next
End Function

============= [In : VBDOXEXT.clsReportManagerEx.printList()]

''
' @history November 2005 - Changes by Adam Yarnott, Blue Ninja Software<ul>
' <li>These Bug, ToDo, and History lists now print out in bulleted and indented form, for better readability.
' </ul>
' @history [irm:120815] Modified 2x Exists(section) to Exists(section, true) for insensitive comparisons

Private Sub printList(fname As String, title As String, section As String, group As clsGroup)

Private Sub printList(fname As String, title As String, section As String, group As clsGroup)
Dim file As Integer
Dim prj As clsProject
Dim mdl As clsModule
Dim entry As clsEntry
Dim TODO As Variant

file = FreeFile
Open fname For Output Access Write As file

beginBody file, title

Print #file, "<!-- ============ "; title; " ============ -->"

Print #file, "<br><h1>"; title; "</h1>"

For Each prj In group.projects
For Each mdl In prj.modules
If mfilter.canDocumentModule(mdl) Then
If Not mdl.getDocComment Is Nothing Then
If mdl.getDocComment.sections.Exists(section, True) Then
Print #file, "<BR><A href="""; naming.GetModuleFileName(mdl); ".html"">"; mdl.getQName; "</A>"
Print #file, "<ul>" 'BNS: Added to enable above-mentioned feature.
For Each TODO In mdl.getDocComment.sections.Item(section)
'BNS: Replaced the following line to enable above-mentioned feature.
'Print #file, "<BR>"; TODO
Print #file, "<li>"; TODO
Next
Print #file, "</ul>" 'BNS: Added to enable above-mentioned feature.
End If
End If

For Each entry In mdl.entries
If efilter.canDocumentEntry(entry) Then
If Not entry.getDocComment Is Nothing Then
If entry.getDocComment.sections.Exists(section, True) Then
Print #file, "<BR><A href="""; naming.getEntryFileName(entry); ".html"">"; mdl.getKey; "."; entry.getName; "</A>"
Print #file, "<ul>" 'BNS: Added to enable above-mentioned feature.
For Each TODO In entry.getDocComment.sections.Item(section)
'BNS: Replaced the following line to enable above-mentioned feature.
'Print #file, "<BR>"; TODO
Print #file, "<li>"; TODO
Next
Print #file, "</ul>" 'BNS: Added to enable above-mentioned feature.
End If
End If
End If
Next
End If
Next
Next

endBody file

Close #file

End Sub

==============

(Hope this is the correct place -- :-D)

Discussion