Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Help with Placement
Topic Summary:
Created On: 20-Dec-2002 18:02
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 20-Dec-2002 18:02
User is offline View Users Profile Print this message


Doina Scafaru

Posts: 28
Joined: 16-Sep-2002

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"

Report this to a Moderator Report this to a Moderator
 23-Dec-2002 17:12
User is offline View Users Profile Print this message


Sylvia Boltic

Posts: 9
Joined: 11-Oct-2002

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
Report this to a Moderator Report this to a Moderator
 23-Dec-2002 19:52
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 23-Dec-2002 22:29
User is offline View Users Profile Print this message


Doina Scafaru

Posts: 28
Joined: 16-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 2-Jan-2003 22:07
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Please provide your included file "locstring.inc".
Report this to a Moderator Report this to a Moderator
 13-Jan-2003 16:34
User is offline View Users Profile Print this message


Doina Scafaru

Posts: 28
Joined: 16-Sep-2002

Send me your e-mail at

doina.scafaru@hoenywell.com

and I'll help you. Doina
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 0 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.