X10 Community Forum

🖥️ActiveHome Pro => ActiveHome Pro General => Help & Troubleshooting => Topic started by: steven r on May 11, 2007, 01:35:27 PM

Title: [How-Do-I] Extract Macro Comments to a Report?
Post by: steven r on May 11, 2007, 01:35:27 PM
I'd love to be able to put comments in my macros.
I've done the next best thing and used the note field on my modules and macros.
Is there anyway, preferably as a report, to print a list of comments with their associated modules and macros?
Title: Re: [How-Do-I] Extract Macro Comments to a Report?
Post by: steven r on May 12, 2007, 11:03:15 AM
Doing a hard drive search, I found the comments in the the file "X10Active.xml" in my directory "C:\Documents and Settings\All Users\Application Data\X10 Settings". I would be nice if there was an easy way to extract comments from the file to a useful report.
Title: Re: [How-Do-I] Extract Macro Comments to a Report?
Post by: TakeTheActive on May 12, 2007, 02:44:06 PM
Quote from: steven r on May 12, 2007, 11:03:15 AM

...It would be nice if there was an easy way to extract comments from the file to a useful report.

An .XML file is lines and lines of ASCII text bracketed by <TAGS>. From my research MONTHS ago (desiring a report from a ReplayTV .XML file - never finished), you can write some VBScript/JavaScript inside an .HTML file and run it under IE (or Firefox I presume):

Quote
<html>
<body>
<title>Parse_XML01 from W3Schools</title>
<script type="text/vbscript">
set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("cd_catalog.xml")
set title=xmlDoc.getElementsByTagName("TITLE")
set artist=xmlDoc.getElementsByTagName("ARTIST")
set cdyear=xmlDoc.getElementsByTagName("YEAR")
document.write("<table align=center valign=top border=4>")
document.write("<tr><td align=center colspan=4><b>Processing Root Node: </b>" & xmlDoc.documentElement.nodeName & "</td></tr>")
document.write("<tr><td><b>Row</b></td><td align=center><b>Title - </b>" & xmlDoc.documentElement.childNodes(0).firstChild.nodeName & "</td><td align=center><b>Artist - </b>" & xmlDoc.documentElement.childNodes(0).firstChild.nextSibling.nodeName & "</td><td align=center><b>Year - </b>" & xmlDoc.documentElement.childNodes(0).firstChild.nextSibling.nodeName & "</td></tr>")

for i = 1 to title.length
  document.write("<tr><td align=right>" & i & "</td><td>" & title.item(i-1).text & "</td><td>" & artist.item(i-1).text & "</td><td align=center>" & cdyear.item(i-1).text & "</td><td><br /></tr>")
next

document.write("</table>")

</script>
</body>
</html>

Diehards could also, I suppose, do similar extractions via *ANY* language, BASIC for example (MBasic, QBasic, VBasic...)