![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Help with Placement Topic Summary: Created On: 20-Dec-2002 18:02 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I have 2 lines of code below that I do know how to handle getting either DXL errors or truncated output. Ian talking about the last 2 lines of code. I get only 1 output. If I move the last line right after the if statement where numstat is counted for I get more objects than are flagged red or errors. Anybody outthere has any better ideas?
/Created on 12/13/02 //Created by Doina Scafaru //This program will return the scorecard status including: /* Module name, date Number of requirements Number of requirements without validation plans defined Object ID and Text Number of requirements without verification plans defined Object ID and Text Number of requirements with the status flagged red Object ID and Text Number of TBD(s)*/ #include <N:/Win/Doors/lib/dxl/addins/As_cps/locstring.inc> int numreq = 0 int numpln = 0 int numver = 0 int numstat = 0 string ver string stat string pln string req int ckflg string tst string tbd = "TBD" int numtbd = 0 bool fflg int fidx int oidx int numotxt = 0 pragma runLim,0 filtering off string currProj = name current Project Object p Object o Module m = current string filename = "C:/Scorecard Metrics.txt" Stream output = write filename for o in m do { //Calculate the total number of requirements req = o."Object Text" if (!null req) ++numreq //Verify text TBDs tst = o."Object Text" if (tst != null) { ++numotxt fflg = true oidx = 0 lentxt = length(tst) while ((oidx < lentxt) && (fflg)) { locstring(tbd,tst,fidx,fflg) if (fflg) { ++numtbd ++fidx tst = tst[fidx:lentxt-1] oidx = oidx + fidx } // End if (fflg) } // End while ((oidx < lentxt) && (fflg)) } // end if (tst != null) // Verify Validation Method pln = o."Validation Method" if (o."Validation Method" == null) ++numpln // Verify Status List stat = o."Stop Light" if (stat == "Red") ++numstat // Verify Verification Method // ver = o."Verification Method" // if (!null ver) ++numver } // Write the metrics data to a file string modname = m."Name" output << "\t\t\t Module : " modname "\n" output << "\t\t\t Date : " today "\n\n" output << "Total number of requirements per module: " numreq "\n\n" output << "Number of TBDs : " numtbd "\n\n" output << "Number of requirements without validation plans defined: " numpln "\n" if ((numpln !=0)) output << identifier (o) " " o."Object Text" "\n\n" output << "Number of requirements without verification plans defined: " numver "\n\n" if ((numver !=0)) output << identifier (o) " " o."Object Text" "\n\n" output << "Number of requirements with the status flagged red: " numstat "\n\n" if ((numstat > 1)) output << identifier (o) " " o."Object Text" "\n" |
|
![]() |
|
![]() |
|
Place your "if statements" at the end in brackets. That may help.
if ((numpln !=0)) { output << identifier (o) " " o."Object Text" "\n\n" output << "Number of requirements without verification plans defined: " numver "\n\n" } if ((numver !=0)) { output << identifier (o) " " o."Object Text" "\n\n" output << "Number of requirements with the status flagged red: " numstat "\n\n" } if ((numstat > 1)) { output << identifier (o) " " o."Object Text" "\n" } Edited: 24-Dec-2002 at 16:53 by Sylvia Boltic |
|
![]() |
|
![]() |
|
When posting please input your DXL using the [Attach Code] button below.
[0] Your "for o in mod do" loop will only consider currently displayed objects. That will be a problem if you are running filters. [1] Your last lines of code refer to Object o, which should be the last object in the module (o having residual value from the "for o in m do" loop). Are you sure that's what you want? [2] I don't know the exact rules, but using attribute references and/or function calls in Print, If, and OutStream lines of code often does not work. I think it has something to do with direct and indirect internal references. No doubt a more-literate "C" programmer can explain it. So your "output << identifier(o)"" lines may be causing problems. Try staging these values in temporary variables, and then output the variable. Also perhaps trying to brace the function calls: output << (identifier(o) "") " " (o."Object Text" "") "\n\n". - Louie |
|
![]() |
|
![]() |
|
Well, I hope a real C programmer sees all this and helps us, because I am as frustrated as before: it still does not work. i wish you all a Happy New Year and a Lovely Christmas! Doina
|
|
![]() |
|
![]() |
|
Please provide your included file "locstring.inc".
|
|
![]() |
|
![]() |
|
Send me your e-mail at
doina.scafaru@hoenywell.com and I'll help you. Doina |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Help with Placement
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.