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: Verify attribute exists in other module
Topic Summary:
Created On: 22-Apr-2003 15:25
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.
 22-Apr-2003 15:25
User is offline View Users Profile Print this message


Mike Conner

Posts: 12
Joined: 22-Apr-2003

How do I check if an attribute exists in another module using DXL? I tried exists(attribute(attRef)) but that only works on the current module.
Report this to a Moderator Report this to a Moderator
 22-Apr-2003 16:29
User is offline View Users Profile Print this message


Dennis Lockshine

Posts: 113
Joined: 7-Apr-2003

To check for the existance of any attribute in a module (m), use the following code:

Module m=current
AttrDef ad=find(m, "Attribute Name")
if(null ad) errorBox "Attribute does not exist in " name(m) "."

-Dennis
Report this to a Moderator Report this to a Moderator
 23-Apr-2003 23:52
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

You need to set the current module to the other module:

1: current = modThatMayHaveTheAttribute
2: (current ModuleRef__) = modThatMayHaveTheAttribute // this syntax is better
if (exists(attribute(attRef))

Setting the current module is a little tricky since OTHER DXL commands may depend on which module is current.

Module mCurr = current
current = modOther
if (exists(attribute(attRef))
...
current = mCurr // resets current

===========

or as Conner pointed out, if you use "find" it doesn't matter which module is "current".

AttrDef ad = find(modThatMayHaveTheAttribute, NameAttr)
if (null ad) print "Module doesn't have the attribute\n"

- Louie
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.