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: Module count
Topic Summary:
Created On: 6-Nov-2004 00:27
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.
 6-Nov-2004 00:27
User is offline View Users Profile Print this message


Srinivas Dasari

Posts: 24
Joined: 13-Dec-2003

I am writing a script to count number of modules in the database and print their titles and description into a word file. The count is a variable which is incremented.

I want the count to be displayed at the top of the word file which is not possible if I am printing the titles and description as I parse thru the modules. One way is to store the titles and description in an array/skiplist. Is there a way to do this without using arrays/skiplists?

Thanks!
Report this to a Moderator Report this to a Moderator
 10-Nov-2004 13:37
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Easiest way to do it is create a string or buffer then append the count to the front of the string/buffer before outputing to file --

Another way is to iterate twice trough the database -- 1st time to generate the count -- 2nd time to generate the list.
Report this to a Moderator Report this to a Moderator
 10-Nov-2004 17:30
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Add the names and descriptions to a buffer. When done with the loop, output the count and the contents of the buffer to the file. May look like:

Buffer Results = create
int Count = 0
Item itm
for itm in database do
{ Results += name(item) "\t" path(itm) "\t" description(item) "\n"
Count++
}
string NameFile = "c:/MyStuff/ModuleNames.txt"
Stream Output = write(NameFile)
Output <- Count "\n" stringOf(Results)
close(Output)
delete(Results)
system ("notepad.exe " NameFile)
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 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 1 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.