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: Can you SET DXL code in a AttributeDXL programmatically?
Topic Summary: Setting DXL code in a AttributeDXL
Created On: 3-Oct-2006 19:19
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 Tony Goodman, on Wednesday, October 4, 2006 5:13 PM

Answer:
Dan, I think you got the function prototype wrong.
I can see why - hte help is very misleading.

Usage is as folows:

AttrDef ad
string dxlString = "obj.attrDXLName = \"hello\""

ad = modify(ad, setDXL, dxlString)
 3-Oct-2006 19:19
User is offline View Users Profile Print this message


Dan Hopping

Posts: 75
Joined: 21-Nov-2002

I can print the DXL code associated with a DXL_attribute (see following DXL) however I have not
been able to SET the value of ad.dxl (I tried string, buffer???).
Does anybody know how to SET a DXL_attribute to a user specified DXL code?
Thanks,
Dan
------------------------

// The following prints the DXL code associated with a specific DXL_attribute
Module m = current
string attrName = "MyAttrDXL"
AttrDef ad
for ad in m do {
if (ad.dxl) {
string dxlName = ad.name
if (dxlName == attrName) {
print dxlName "\n"
string dxlVal = ad.dxl
print dxlVal "\n"
}
}
}
Report this to a Moderator Report this to a Moderator
 3-Oct-2006 20:04
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Try something like:

AttrDef ad = create object type "Integer" attribute "cost" dxl "int i = 10 \n obj.attrDXLName = i "
Report this to a Moderator Report this to a Moderator
 3-Oct-2006 22:43
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Why use so few words when you can go on for paragraph after paragraph like I do?
Report this to a Moderator Report this to a Moderator
 4-Oct-2006 14:15
User is offline View Users Profile Print this message


Dan Hopping

Posts: 75
Joined: 21-Nov-2002

Ron,
Thank you for the answer to my question. You, in fact, answered my question very well. I just asked the wrong question. I am actually trying to MODIFY the DXL code in an existing DXL_Attribute. The construct to modify a DXL is (from DXL Help):
AttrDef modify(AttrDef old, [setproperty value,] AttrDef new)
the setproperty value is setDXL
I have used this to Modify attribute History, Default values, Hidden etc... but never successfully to modify attribute DXL code?
I have tried various combos for the AttrDef old and new but with little success.
Has anyone used modify(AttrDef old, [setproperty value,] AttrDef new) to successfully modify text attributes successfully?
Thank you Again,
Dan

Report this to a Moderator Report this to a Moderator
 4-Oct-2006 16:23
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Answer Answer
Dan, I think you got the function prototype wrong.
I can see why - hte help is very misleading.

Usage is as folows:

AttrDef ad
string dxlString = "obj.attrDXLName = \"hello\""

ad = modify(ad, setDXL, dxlString)

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 4-Oct-2006 17:17
User is offline View Users Profile Print this message


Dan Hopping

Posts: 75
Joined: 21-Nov-2002

Arrrrrggggg!
I actually tried this first thing and had a singe silly error in my string that caused it to fail.
That's when I really studied the docs and found the misguided Doors Help directions.
THANK YOU!
Dan
Report this to a Moderator Report this to a Moderator
 4-Oct-2006 17:22
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

DXL is great isn't it!

-------------------------
Tony Goodman
http://www.smartdxl.com
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.