![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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.
|
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Verify attribute exists in other module
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.