Getting Associated Comments |
If associated comments have been stored in the database, they may be retrieved for an entity. Only the C and Ada versions of Understand currently store information about associated comments. See $ent->comments() for detailed information.
foreach $func ($db->ents("function ~unresolved ~unknown")) { @comments = $func->comments("before"); if (@comments) { print $func->longname(),":\n"; foreach $comment (@comments) {print " ",$comment,"\n";} print "\n"; } }
To associate comments when the C and Ada versions of Understand, use the -comment command line option or the Associate Comments setting in the Options tab of the Project->Configure dialog.
Associated comments are comments that occur near the declaration of an entity in source code. Some entity kinds have different kinds of declarations, which can be explicitly specified. Also, comment position, before or after the declaration, can be specified.
The returned comments can be a formatted string (the default) or may be an array of raw comment strings.
Scientific Toolworks, Inc. http://www.scitools.com |