![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: need a DXL code piece Topic Summary: Created On: 16-Apr-2007 11:11 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Hi Manju, here is a small caode snippet to be a starting point for your developement Greetings Reik | |
![]() |
|
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. |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
Oh Thanks Reik,
its really very nice of u for such instant help. thanks a ton. ur code worked just fine for my case. |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
need a DXL code piece
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.