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: Need DOORS DXL Basic Help
Topic Summary: Need DOORS DXL Basic Help
Created On: 21-Feb-2007 21:44
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.
 21-Feb-2007 21:44
User is offline View Users Profile Print this message


Tracy Monteith

Posts: 33
Joined: 21-Dec-2005

What's wrong with this code??   I get an error:  "Incorrect arguments for function print."  I simply want to print  object."Attribute Name"


Module m = current

Object oSelect = null

for oSelect in m do

{

    print oSelect."Object Heading"

}

Report this to a Moderator Report this to a Moderator
 21-Feb-2007 22:06
User is offline View Users Profile Print this message


Tracy Monteith

Posts: 33
Joined: 21-Dec-2005

There's the error... -E- DXL: incorrect arguments for function (print) -I- DXL: all done with 1 error and 0 warnings
Report this to a Moderator Report this to a Moderator
 21-Feb-2007 22:13
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Change oSelect."Object Heading"
to oSelect."Object Heading" ""
Report this to a Moderator Report this to a Moderator
 23-Feb-2007 20:55
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

The construct <oSelect."Object Heading"> is of type "AttrRef_" and is not a string. If you assign an AttrRef_ to a string variable, DOORS knows to extract the value from the obj-attr. See the section " Assignment (from attribute)" in the DXL manual chapter 'Attributes'. If you concatenante an AttrRef_ with a string, DOORS knows to extract the attr value and concatenate that.

string s = obj.NameAttr // works. Attr value is extracted and assigned.
o1 = o2.NameAttr "" // works. Attr value is extracted and converted to a string, then assigned.
o1 = o2.NameAttr // fails. You cannnot assigne AttrRef_ variable to an 'Object'.

However, the print command must take a string. So you need to force extraction of the attr value by concatenation with a string:

print oSelect."Object Heading" "" // Concatenante with two double quotes is common.

Also...

if (oSelect."IsReq") // fails. If demands a 'boolean' not an AttrRef_ variable.
if (oSelect."IsReq" == "True") // fails. Cannot compare an AttrRef_ with a string.
if (oSelect."IsReq" "" == "True") // works. Value is extracted and compared to True

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