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: "Date" problems
Topic Summary:
Created On: 1-Jul-2004 18:33
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.
Answer This question was answered by David Rose, on Friday, July 23, 2004 3:37 PM

Answer:
Thanks for all the help. I solved my own problem by using a get statement to bring the DBE entry into the rest of my script.
 1-Jul-2004 18:33
User is offline View Users Profile Print this message


David Rose

Posts: 80
Joined: 10-Oct-2003

I have developed a need to be able to scan all the object histories in a project and compare the date of the most recent change to a specified date. This comparison needs to be outputted to a report listing all the objects with changes after the specified date. I've managed to whip together the code for all the date retrievals and comparisons, and the report, when the date is hard coded into the script. My problem comes with setting it up for my user to identify the date they need to compare. I've build a DB box, but I can't get the data from the DB Box to convert to a Date. If anyone has any insight on this I'd appreciate it.

Object o
Module n = current
Date d
History hr
string p = ""

DB SETDATE = create "Set Date to search from"
DBE e = field(SETDATE,"Date: ","",30)

void dated(DB box) {
Date d = string e
}
ok(SETDATE, "Search",dated)

show SETDATE

// Check the user is in a requirements module
string cmodname = n."Name"
cmodname = cmodname[0:2]
if (cmodname != "REQ") {
ack "This function can only be run from a requirements module."
halt
}

string filename = "C:/change dates.txt"
Stream wfile = write filename

for p in current Project do {
ckmod = p
Module m = read(ckmod,false)

// Check the module is a requirement module
mtype = type m
string modname = m."Name"
string modtyp = modname[0:2]
if ((mtype == "Formal") && (modtyp == "REQ")) {

for o in m do{
string modName = m."Name"
for hr in o do {
if hr.date >d then
{
string an = probeAttr_(o,"Object Identifier")
wfile << ""modName "\t"an "\t"hr.date"\n"
}
} //end of for hr in o do

} //end of for o in m do
if ((p != "Users") && (n != m)) close m
} //end of if ((mtype == "Formal") && (modtyp == "REQ"))

} //end of for p in current Project do



-------------------------
David A. Rose TSgt USAF
NCOIC System Administration


Edited: 1-Jul-2004 at 19:41 by David Rose
Report this to a Moderator Report this to a Moderator
 1-Jul-2004 20:02
User is offline View Users Profile Print this message


Dennis Lockshine

Posts: 113
Joined: 7-Apr-2003

I've developed a quick test for validating the date input for a given field. Esentially you need to:

1. Trap errors with noError
2. Convert the string to a date variable
3. Check for errors using lastError

See the attached code for an example.

-Dennis

Report this to a Moderator Report this to a Moderator
 2-Jul-2004 21:53
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Attached fDateOf() does it, and uses fIsValidDate().
Report this to a Moderator Report this to a Moderator
 23-Jul-2004 15:37
User is offline View Users Profile Print this message


David Rose

Posts: 80
Joined: 10-Oct-2003

Answer Answer
Thanks for all the help. I solved my own problem by using a get statement to bring the DBE entry into the rest of my script.

-------------------------
David A. Rose TSgt USAF
NCOIC System Administration
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.