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 a DXL code piece
Topic Summary:
Created On: 16-Apr-2007 11:11
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 Reik Schroeder, on Monday, April 16, 2007 12:30 PM

Answer:
Hi Manju,

here is a small caode snippet to be a starting point for your developement

Greetings
Reik
 16-Apr-2007 11:11
User is offline View Users Profile Print this message


Manju Chechi

Posts: 15
Joined: 21-Nov-2006

Can ane one here provide me a code snippet that expalins hoe can I fetch data from DOORS client based on is null n  not null in a where clause.

I want to fetch all the requirements in a module for which object text is null.

I am new on this block n will be gr8ly motivated if gets some help.

Thanks in advance.
Report this to a Moderator Report this to a Moderator
 16-Apr-2007 11:24
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Answer Answer
Hi Manju,

here is a small caode snippet to be a starting point for your developement

Greetings
Reik

-------------------------
Evosoft GmbH
for Siemens Industry Sector


Berlin, Germany
Report this to a Moderator Report this to a Moderator
 16-Apr-2007 12:10
User is offline View Users Profile Print this message


Manju Chechi

Posts: 15
Joined: 21-Nov-2006

Oh Thanks  Reik,

its really very nice of u for such instant help.

thanks a ton. ur code worked just fine for my case.
Report this to a Moderator Report this to a Moderator
 17-Apr-2007 16:50
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

If you read the DXL manual carefully you will notice that <obj."Object Heading"> is an 'attrref'. Its hidden type is 'AttrRef_'; but that's not in the manual. If you also read the manual you'll see that <string s = obj."Object Text"> assigns the text found in the attrref to the string. You will also find that <obj."Object Text" ""> retrieves the text of the attrref.

Notice you won't find this in the manual: <if (obj."IsReq") {...}>. That's because the if clause demands a boolean but what you have is an attrref. Assuming that attr 'IsReq' is type boolean, you can do one of these instead: <bool IsReq = obj."IsReq"; if (IsReq){...}> or <if (obj."IsReq" "" == "True") {...}. Notice in the 2nd example you are concatenating an empty string to the attrref, which forces its conversion to string, which lets you compare it to the string version of boolean True.

Note also that <if (null obj."MyAttr") {A}> will cause DXL errors if obj is null or undefined, and will cause A to run only if MyAttr doesn't exist for objects in the module. If you want A to run when the object has no value for MyAttr, again concatenate: <if (null obj."MyAttr" "") {A}>.

Be advised that 'null' is not exactly the same as "", or zero for int or 0.0 for real. I don't recall the exact cases, but every now and then I have to do this: <if (null Value) Value = "">; usually after Value is set (or ignored) by a previous function call.

- Louie
Report this to a Moderator Report this to a Moderator
 18-Apr-2007 16:00
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

That's interesting Louie, I have zillions of functions that return an empty string on success, otherwise an error message. However, when passing return values back that originated from builtin perms I have also had to convert null into an empty string.

Lately I have changed my mind and done it slightly differently:

string res = functionCall()

if (res "" != "")
{
// handle error...
}

This works if res is null or an empty string.

I never did figure out why this happens though...

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 18-Apr-2007 21:58
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

A lot of my functions defined a return value early, perhaps <string RetVal = "">, then proceed to calculate RetVal if needed. This seems to work better than <string RetVal = null>.

What I was really getting at was modifying aliased call parameters. A few of my functions had to define parellel variables to house the value during execution, then set the call parameters at the bottom of the function. See attached. Yuuuuck.

Don't know enough about compilers or interpreters to figure out what's going on; but I think we really need to find out what's the REAL differences between "null" and empty ""; and possibly if there is a difference between a null integer and Zero, etc for the other variable types.

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