It's all about the answers!

Ask a question

Having issues with my script


Christopher Cote (1516) | asked Jun 07 '21, 10:15 a.m.

I have a script that appears to be getting called twice, but I only see it once after it has been defined.  Here is an abbreviated version of my code:

Stream outMain = write CMG_USER_DESKTOP \\DLDUpdates.html
Buffer bufHTML = create;
Skip
storeAllObjects(Module m) {
     Object o;
     Skip sk = create();
     int absNum = 0;

     Baseline lastBL = getMostRecentBaseline(m);
     Module mBaseline = load(m, lastBL, true);

     for o in entire mBaseline do {
          absNum = o."Absolute Number";
          put(sk, absNum, o);
     }
     return sk;
}
void writeHTMLHeader(Stream& out) {
     setempty(bufHTML)
     
     bufHTML += "<!DOCTYPE html>\n";
     bufHTML += "<html moznomarginboxes mozdisallowselectionprint>\n";
     bufHTML += "<head>\n";
     
     bufHTML += "<style>\n";
     bufHTML += "   body {\n";
     bufHTML += "        font-size: 11.5px;\n";
     bufHTML += "   }\n";
     
     bufHTML += "</style>\n";
     bufHTML += "</head>\n";

     out << bufHTML;
     infoBox("Write HTML Header\n" bufHTML "");
}
void createNewUpdatedFunctionsReport(Stream& out) {
     Module m = read("DXL Library Data - Customized", true);
     Object obj;
     int absNum;
     Skip skOldObjs = create();

     skOldObjs = storeAllObjects(m);
     bufHTML += "<body>\n"
     for obj in current(m) do {

     absNum = obj."Absolute Number";
     infoBox("Absolute Number: " absNum ""); 
     bufHTML += "</body>\n"
     bufHTML += "</html>\n"
     out << bufHTML;
}
writeHTMLHeader(outMain);
createNewUpdatedFunctionsReport(outMain);
I don't understand, but writeHTMLHeader is being written twice.  And the createNewUpdatedFunctionsReport is called but it doesn't get into the for-loop.
Is there anyone out there who can help me out with this?

2 answers



permanent link
Christopher Cote (1516) | answered Jun 09 '21, 8:09 a.m.
edited Jun 09 '21, 8:10 a.m.

I'm actually missing an ending curly brace that I need after the infoBox in createNewUpdatedFunctionsReport.  That would close the for-loop.  Thanks for the 2nd look.


permanent link
Christopher Cote (1516) | answered Jun 07 '21, 10:17 a.m.

There is an ending curly brace at the end of the for-loop after the infoBox.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.