![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() 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 | |
![]() |
|
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 |
|
![]() |
|
![]() |
|
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/ |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.