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: Filter for "Created On" = "Today"
Topic Summary:
Created On: 6-Jun-2007 15:45
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 Chris Annal, on Wednesday, June 6, 2007 6:06 PM

Answer:
Simple, simple, simple. I forgot the parenthesis around the compared objects. The following script works just fine!! Thanks again!!

Module m = current

Object o

Date d2 = dateOnly(today)

for o in m do {

Date d1 = o."Created On"

if (d1 == d2)

{

print d2

}//end if

}//end do

 6-Jun-2007 15:45
User is offline View Users Profile Print this message


Chris Annal

Posts: 36
Joined: 14-Dec-2005

This should be simple, but I can't seem to get it right!! I've gone through all the DXL Help files in DOORS, but can't seem to locate a method for filtering a module to display only those objects that were created "today". It seems I have to specify today's date, but since I want to include this script as part of a batch process, "today" will always be the current date from day-to-day. I don't want to have to manually change the date each day, since that would defeat the purpose of the batch process. Does DXL include a variable for "today" that will be interpreted as "get the current date"?
Report this to a Moderator Report this to a Moderator
 6-Jun-2007 16:23
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Hi Chris,

you are so near to the resolution, that you won't see it ;-))

You are right! There is a function to get the current date (and time) - it is called Date today ()
You can convert the result to string by adding an empty string:


print today""


BTW: You should not have defined a variable named today. If so, Doors will prefer this and prevent you from calling function today() !!

Grretings
Reik

-------------------------
Evosoft GmbH
for Siemens Industry Sector


Berlin, Germany
Report this to a Moderator Report this to a Moderator
 6-Jun-2007 17:39
User is offline View Users Profile Print this message


Chris Annal

Posts: 36
Joined: 14-Dec-2005

Thanks Reik,

That set me on the right path. However, I'm still getting syntax issues with the following script, which is only a test to see if I can at least display the date in the DXL window. (Once I get this working, I plan on using it as the basis for filtering to display only objects that meet this condition in the module:

Module m = current

Object o

Date d2 = dateOnly(today)

for o in m do {

Date d1 = o."Created On"

if d1 == d2

{

print d1

}

}

Report this to a Moderator Report this to a Moderator
 6-Jun-2007 17:43
User is offline View Users Profile Print this message


Chris Annal

Posts: 36
Joined: 14-Dec-2005

Oops. I forgot to mention that if I remove the conditional (if) statement and the curly brackets above and below the "print" statement, then it will print either d1 or d2 when I want it to - it's only the syntax of the comparison (regardless of whether I use "=" or "==" for comparision) that seems to be the source of the syntax error, as far as I can tell.

Thanks!!

Chris
Report this to a Moderator Report this to a Moderator
 6-Jun-2007 18:05
User is offline View Users Profile Print this message


Chris Annal

Posts: 36
Joined: 14-Dec-2005

Answer Answer
Simple, simple, simple. I forgot the parenthesis around the compared objects. The following script works just fine!! Thanks again!!

Module m = current

Object o

Date d2 = dateOnly(today)

for o in m do {

Date d1 = o."Created On"

if (d1 == d2)

{

print d2

}//end if

}//end do

Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.