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: Converting integer to string or displaying in attribute layout column
Topic Summary:
Created On: 27-Aug-2008 23:29
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 Diane Cherry, on Thursday, August 28, 2008 1:42 PM

Answer:
David,
Thanks for your response with the print handling.
I was looking for some way to be able to use display functions to put these results into the DXL column displayed in DOORS.

Following Tony's and your responses I tried the following which worked:

int intVariable = 5
string temp = intVariable ""
display(temp)

Diane
 27-Aug-2008 23:29
User is offline View Users Profile Print this message


Diane Cherry

Posts: 11
Joined: 22-Dec-2006

I would like to be able to add a little debug output to some layout attribute DXL functions I am working with.

I have not been able to find anyway to have the local integers I'm working with converted or formatted to be able to display them in the column of the view in DOORS.

I know I can print the variable to the DXL window, but was hoping to capture this output in the column.

any suggestions would be appreciated

Diane
Report this to a Moderator Report this to a Moderator
 28-Aug-2008 06:15
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

Concanate the integer with "" (empty string)

i.e. in layout DXL column

int i = 3
display i ""

-------------------------
Pekka.Makinen@softqa.fi
SoftQA Oy -http://www.softqa.fi/
Report this to a Moderator Report this to a Moderator
 28-Aug-2008 11:32
User is offline View Users Profile Print this message


Tony Goodman

Posts: 97
Joined: 6-May-2008

Diane,

A few suggestions to make life easier.

Write and edit your Layout DXL in a text file, say "C:/temp/myScript.dxl", using any text editor.

Create your layout dxl column and add #include <c:/temp/myScript.dxl> as the code. Save the view.

Now you can edit the code in your editor, save the file and test it by reloading the view.

If it is attribute DXL you are writing then test it my selecting Tools > Refresh DXL attributes.

Also, use a module with just a few objects. This way you won't have to dismiss loads of error dialogs when things go wrong.

When you are happy with the code, copy the code into the column or DXL attribute, and save the view again.

-------------------------
Tony Goodman
Smart DXL limited
www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 28-Aug-2008 13:08
User is offline View Users Profile Print this message


Diane Cherry

Posts: 11
Joined: 22-Dec-2006

Tony, Thank you for the answer to my initial question and for the additional helpful suggestions.

I wonder if you can also tell me how I could add the integer to a formatted string for ouput. I haven't seen any printf equivalent display functions.

Thanks again for any help.
Diane
Report this to a Moderator Report this to a Moderator
 28-Aug-2008 13:15
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Just put the integer in with the string where you want it. DXL automatically converts the type.

int one = 1
int two = 2
print one " plus " one " = " two "" is perfectly legal.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 28-Aug-2008 13:38
User is offline View Users Profile Print this message


Diane Cherry

Posts: 11
Joined: 22-Dec-2006

Answer Answer
David,
Thanks for your response with the print handling.
I was looking for some way to be able to use display functions to put these results into the DXL column displayed in DOORS.

Following Tony's and your responses I tried the following which worked:

int intVariable = 5
string temp = intVariable ""
display(temp)

Diane

Edited: 28-Aug-2008 at 13:40 by Diane Cherry
Report this to a Moderator Report this to a Moderator
 28-Aug-2008 15:39
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

You don't need the temporary string variable. As Pekka said, you could just do display(intVariable"").

For DXL columns (and DXL attributes) one smart thing to do is if you plan to do a lot of text, use Buffers and after you display your data, delete the buffer. Otherwise your string table will be huge. When doing display, use tempStringOf(Buffer b) to print the value without using the string table. It can make a HUGE difference in module performance.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.