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: Current Attribute
Topic Summary:
Created On: 20-Dec-2006 13:34
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 Mike Malloy, on Wednesday, December 20, 2006 8:57 PM

Answer:
I figured out the skip list approach before I gould the output string approach.

Just to close the loop, here's what I went with:

string data
Skip var = createString()
if(matches("Jason McMan", obj."Name" ""))
{
put (var, "Yes", "xx")
for data in var do
{
if((string key var)!=null)
{
displayRich "Jason McMan is here"
}
delete var
}
}

 

 20-Dec-2006 13:34
User is offline View Users Profile Print this message


Mike Malloy

Posts: 9
Joined: 12-Dec-2006

I'm using a code piece that looks like: 

if(matches("Jason McMan\n", obj."Name" ""))
{
displayRich "Jason McMan is here."  
}

But, if Attribute "Name" contains ['Jason McMan" newline "Jason McManson" newline "Jason McMan"], then the above code will return "Jason McMan is here" twice.  How can I check to make sure that if "Jason McMan" has already been returned, it won't return it a second time?  

The attribute is one I created from the Analysis Wizard, so I don't think its a '"real" attribute (and I have no idea what the name of it is either).  I want to go with something like this:

if((matches("Jason McMan\n", obj."Name" "")) && (!matches("Jason McMan is here", *****))) 
{
displayRich "Jason McMan is here."  
}

where "*****" is the attribute I am writing all this code for.

Any help with this syntax?

Thanks,
Mike 
Report this to a Moderator Report this to a Moderator
 20-Dec-2006 16:02
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

One approach is to build a skip list -- then
display skiplist by iterating thru the skiplist
Report this to a Moderator Report this to a Moderator
 20-Dec-2006 16:17
User is offline View Users Profile Print this message


Mike Malloy

Posts: 9
Joined: 12-Dec-2006

Is it possible to just do a "!matches" in the attribute?  Is there something I can replace "****" with to do that?  I guess I'm leaning toward this method because this is how I always did it in VB. 

Any idea?

Report this to a Moderator Report this to a Moderator
 20-Dec-2006 16:44
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

You can also build an output string -- and check for a matches in the output string before adding to the output string --

then display output string
Report this to a Moderator Report this to a Moderator
 20-Dec-2006 17:57
User is offline View Users Profile Print this message


Mike Malloy

Posts: 9
Joined: 12-Dec-2006

Ron, the "output string" solution looks like a winner to me.  Can you give me a sample of the code?
Here's my shot:

Buffer result = create ()
if((matches("Jason McMan\n", obj."Name" "")) && (!matches("Jason McMan is here", result))) 
{
set(result, result"\nJason McMan is here") 
//Is this how I can set result = result + "\n" + "Jason McMan is here"?
{
displayRich (tempStringOf result)  
}
}
delete result

Report this to a Moderator Report this to a Moderator
 20-Dec-2006 20:57
User is offline View Users Profile Print this message


Mike Malloy

Posts: 9
Joined: 12-Dec-2006

Answer Answer
I figured out the skip list approach before I gould the output string approach.

Just to close the loop, here's what I went with:

string data
Skip var = createString()
if(matches("Jason McMan", obj."Name" ""))
{
put (var, "Yes", "xx")
for data in var do
{
if((string key var)!=null)
{
displayRich "Jason McMan is here"
}
delete var
}
}

 

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.